Rest API Article Application implemented in Laravel 7.21
-
Get All Articles
-
Get single Article
-
Add new article
-
Update existing Article
-
Delete Article
-
Copy .env.example file to .env file and update mysql database configuration
-
Run commands :
composer install
composer dump-autoload
composer clear-cache
-
Run command :
php artisan serve
Application will listen on http://127.0.0.1:8000
-
Database Migrations : Migrations script create tables into given database.
Before actually run migrations script, make sure you have a database created for this app and add its credentials to the .env file located in the root of the project.
DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=homestead DB_USERNAME=homestead DB_PASSWORD=secret
Run command :
php artisan migrate
-
Database Seeding :
Database seeding is the process of filling up our database with dummy data that we can use to test it.
php artisan db:seed
-
Run command :
php artisan key:generate
npm install && npm run dev
php artisan serve
Application will listen on http://127.0.0.1:8000
-
Done !!!
Reference : https://www.toptal.com/laravel/restful-laravel-api-tutorial