Laravel CRUD Operations

  • Create the controller:
  • php artisan make:controller RecordsController --resource
  • Create the model
  • php artisan make:model Record
  • Create the table
  • php artisan make:migration create_table_records
  • Create the route
  • Route::resource('records', RecordsController::class);
  • Create the views files
  • inside the views/dashboard create a new folder call it records and inside it create 4 files like this :
    • index.blade.php
    • create.blade.php
    • edit.blade.php
    • show.blade.php

  • Set the index function inside the controller
  • return view('dashboard.records.index');