mithunjmistry / ecommerce-React-Redux-Laravel

E-commerce web app implementation in React front-end with Redux and PHP Laravel backend with MySQL database.
https://www.ecommerce.mithunjmistry.com
MIT License
118 stars 67 forks source link

Got it working #29

Open efillman opened 5 years ago

efillman commented 5 years ago

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)

Keerthi001 commented 5 years ago

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

efillman commented 5 years ago

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.