Install Laravel and Create a New Application:
composer global require laravel/installer
laravel new crudposts
Create a Database:
.env
file (located at the root of your Laravel app) with your database credentials:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=your_database_name
DB_USERNAME=your_database_username
DB_PASSWORD=your_database_password
Create a Table:
php artisan make:migration create_companies_table
php artisan migrate
Create a Controller:
php artisan make:controller CompanyController
Set Up the Model:
Company
table:
php artisan make:model Company
Add Routes:
routes/web.php
file for creating, reading, updating, and deleting companies.Generate Blade Files:
Deploy and Test Your CRUD Application: