July 2018
Intermediate to advanced
420 pages
8h 46m
English
Let's see another feature of the Artisan CLI, creating all of the Create, Read, Update, and Delete (CRUD) operations using a single command.
First, in the app/Http/Controllers folder, delete the BandController.php file:
php artisan make:controller BandController --resource
This action will create the same file again, but now, it includes the CRUD operations, as shown in the following code:
<?phpnamespace App\Http\Controllers;use Illuminate\Http\Request;class BandController extends Controller { /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { // } /** * Show the form for creating ...Read now
Unlock full access