I want to store some photos for a product using sql?

0 votes
hi every one.

 i want to store some photos for a product. i should use polymorphic and relationships in Laravel. did it but i do not know how should store photos name in images table. this table has this schema :
        Schema::create('images', function (Blueprint $table) {
            $table->id('id');
            $table->text('file');
            $table->unsignedInteger('imageable_id');
            $table->string('imageable_type');
            $table->timestamps();
        });
Sep 28 in PHP by anonymous
• 120 points
31 views

1 answer to this question.

0 votes

Hello,

if you are going to store the images for only 1n1 relation dont use polymorphic. Use usual table.

answered Sep 28 by Niroj
• 67,020 points

Related Questions In PHP

0 votes
1 answer

How to install a specific version of package using Composer?

Hello, Just use php composer.phar require For example : php ...READ MORE

answered Apr 1 in PHP by Niroj
• 67,020 points
412 views
0 votes
1 answer

What are the best way to allow plugins for a PHP application?

Hii, Here is an approach I have  used, it's ...READ MORE

answered Apr 1 in PHP by Niroj
• 67,020 points
83 views
0 votes
1 answer

What is the best way to allow plugins for a PHP application?

Hello @kartik, I've used, it's an attempt to ...READ MORE

answered Apr 15 in PHP by Niroj
• 67,020 points
61 views
0 votes
1 answer

How do I let PHP to create subdomain automatically for each user?

Hello @kartik, We setup wildcard DNS like they ...READ MORE

answered Apr 20 in PHP by Niroj
• 67,020 points
621 views
+1 vote
2 answers

Scp Php files into server using gradle

Tru something like this: plugins { id ...READ MORE

answered Oct 11, 2018 in DevOps & Agile by lina
• 8,220 points
242 views
0 votes
1 answer

How do I create folder under an Amazon S3 bucket through PHP API?

Of Course, it is possible to create ...READ MORE

answered Apr 24, 2018 in AWS by anonymous
6,504 views
0 votes
1 answer

Failure uploading Image on AmazonS3 with PHP SDK

Try this, I took it out from ...READ MORE

answered May 4, 2018 in AWS by Cloud gunner
• 4,650 points
1,167 views
0 votes
1 answer

Trying to call AWS API via PHP

Try using AWS SDK for PHP, Link ...READ MORE

answered Jun 6, 2018 in AWS by Cloud gunner
• 4,650 points
604 views
0 votes
1 answer

How can I connect to a Tor hidden service using CURL in PHP?

Hello @kartik, I use Privoxy and cURL to scrape Tor ...READ MORE

answered May 19 in PHP by Niroj
• 67,020 points
679 views
0 votes
1 answer

How Do I Get the Query Builder to Output Its Raw SQL Query as a String?

Hello @kartik, Use the toSql() method on a QueryBuilder instance. DB::table('users')->toSql() would return: select * ...READ MORE

answered Jul 21 in PHP by Niroj
• 67,020 points
80 views