composer install
composer dump-autoload
composer update
Database Schema Generation
php artisan serve --port=8020
php artisan migrate
php artisan migrate --seed
php artisan migrate:refresh
php artisan migrate:refresh --seed
php artisan serve --port=8020 --host=0.0.0.0
When quizzes
table is deleted :
php artisan make:migration create_quizzes_table
php artisan migrate
- To Double Check :
- Migration Status: You can check the status of your migrations using the command:
- Rollback & Re-migrate: If needed, you can rollback the last batch of migrations (which will drop the tables) and then re-run them.
php artisan migrate:status
php artisan migrate:rollback
composer require barryvdh/laravel-ide-helper
https://stackoverflow.com/questions/68515548/phpstorm-says-find-method-not-found
https://techvblogs.com/blog/laravel-10-crud-example-tutorial-for-beginners
https://getbootstrap.com/docs/5.3/components/carousel/
Installation Instructions
Follow these steps to install and deploy the application.
Deployment
Extract the archive and place it in the desired folder.
Run
cp .env.example.env
file to copy example file to.env
Then edit your
.env
file with database credentials and other settings.Install dependencies using the following command:
php artisan serve --port=8020
Notice
: seed is important, because it will create the first admin user for you.Check this config before I start :
https://stackoverflow.com/a/65464353/10216101
Default Credentials
Use the following credentials for the initial login:
[email protected]
password
Modify the Controller:
Each method in the controller (typically index, store, show, update, destroy) should return a JSON response.
Ensure that each method handles data validation, business logic, and error handling appropriately.
Testing with Postman:
For each method in the controller, create a corresponding request in Postman.
Test the index method (GET request) to list all permissions.
Test the store method (POST request) to create a new permission.
Test the show method (GET request) to display a specific permission.
Test the update method (PUT/PATCH request) to update a permission.
Test the destroy method (DELETE request) to delete a permission.
Ensure you handle authentication in Postman, possibly using the token obtained from the login API.
Consider Pagination and Filtering:
For the index method, consider implementing pagination and filtering if your application expects a large number of records.
Error Handling:
Ensure that your API endpoints return meaningful error messages and appropriate HTTP status codes.
POSTMAN PREREQUEST that I used to do :
.env.example
: