ecommerce-React-Redux-Laravel icon indicating copy to clipboard operation
ecommerce-React-Redux-Laravel copied to clipboard

Got it working

Open efillman opened this issue 5 years ago • 2 comments

Just in case you were just nuts like me and had to see if you could get it working.

Make sure to run: add your redis server settings to .env php artisan migrate:fresh php artisan passport:install --force copy given keys into .env template php artisan db:seed (to get the test data added in)

efillman avatar Jun 03 '19 00:06 efillman

I am getting error like Doctrine\DBAL\Driver\PDOException::("SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child r ow: a foreign key constraint fails (react_laravel.photos, CONSTRAINT photos_productid_foreign FOREIGN KEY (productId) R EFERENCES product (productId))")

While run the php artisan db:seed command, please suggest me Thank you

Keerthi001 avatar Jul 08 '19 09:07 Keerthi001

Yea looks like I had a weird typo there in the seeder. You can either comment out the seeder or modify it.

The photo is blob type so it should be something like this.

\App\Photo::create([ 'photo' => 0x8, 'productId' => 1, 'created_at' => NULL, 'updated_at' => NULL, ]);

Also if you're new to Laravel I definitely don't recommend starting with this project. This project required one to have a solid base of Laravel as the backend and then its a good start to learn React as the front end, if you don't already know Laravel you will get lost pretty fast.

efillman avatar Jul 08 '19 17:07 efillman