Creating a Laravel project
- Install compose
- Create project
composer create-project --prefer-dist laravel/laravel <project-name>
- Edit .env with database details
- Install composer dependencies
composer install
php artisan migrate
- Add breeze (for authentication)
composer require laravel/breeze
- Install blade (for views)
php artisan breeze:install blade
php artisan make:model <Model-name> -m
- Edit the migration
- Run the migration
php artisan migrate
- Update the app/Models/<Model> with the fields
class Bookmark extends Model
{
protected $fillable = ['author', 'url', 'content', 'posted_timestamp'];
}
php artisan make:controller Api/<Model-name>Controller --resource --api --model=<Model-name>