This is an webapp made by Adam and Emma where you as a user can post your best resturant tips, view others tips and even vote for the ones you think are the best ones. Amazing! You will never have to think about where you should eat again, just look at the tips and you will for sure know where to eat.
- Clone down the repo
- npm install
- composer install
- run npm run dev
- php artisan serve to run the project
- Tips use DatabaseSeeder and factories to automate putting data in your db.
- Add error handling on register.blade.php
- Add validate on Controllers\LoginController.php
$request->validate([ 'email' => 'required|email', 'password' => 'required', ]);
- Make relationships this way so you can use MySQL error handling.
Schema::table('posts', function (Blueprint $table) { $table->foreignId('user_id')->constrained(); });
- Make use of resource controllers for example to auth
- This controllers don´t make any thing. Consider removing them.
- CategorieController
- PostResturantController
- PriceController
- Be consequence with @CSRF in yours form.
- Category migration be in plural
categorytocategorys. - Some tests are missing the "use RefreshDatabse" which is good practice to use.
- Make shore to use
test_in the name of every test function in the test file. - Comment in
DB_CONNECTIONandDB_DATABASEin phpunit.xml. So it doesn't use MySQL. - Welcome.blade.php not in use.
- LikesController.php instead of only redirect back to index use an
withError(). - LikesController.php on line 27 write
instedd of:
Like::create([ 'user_id' => $user_id, 'resturant_id' => $resturant_id, ]);
$likes = Like::create([ 'user_id' => $user_id, 'resturant_id' => $resturant_id, ]);
- Follow Laravels recommendations on logging out an user
- Move all the logic in index.blade.php and dashboard.blade.php to an controller if possible.
- Be sure when to use
redirect()->intended()and only redirect() - In your prices table consider to change price column to int. It makes it easier to use it in blade file when it is a int type
- In resturant migration filen add
unique()to name colum so it looks like this$table->string('name')->unique(). It means that there cannot be more than one restaurant with that name. - You have miss out comment. Are you stil using it?