0% found this document useful (0 votes)
8 views

Controller

Controller

Uploaded by

jobs.vipul711
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Controller

Controller

Uploaded by

jobs.vipul711
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

CONTROLLER

BASIC CONTROLLERS
To quickly generate a new controller, you may run the make:controller
Artisan command. By default, all of the controllers for your application
are stored in the app/Http/Controllers directory:

php artisan make:controller UserController


RESOURCE CONTROLLERS
Laravel resource routing assigns the typical create, read, update, and
delete ("CRUD") routes to a controller with a single line of code.
This command will generate a resource controller
php artisan make:controller PhotoController --resource
DEFINE CONTROLLER IN WEB OR ROUTE
use App\Http\Controllers\MyController;
use App\Http\Controllers\ResourceController;

Route::get('/test',[MyController::class,'index']);
Route::get('/test2',[ResourceController::class,'index']);
PART – 1 STRING
DEFINE STRING INSIDE THE CONTROLLER
PART – 2 VIEW
DEFINE STRING INSIDE THE CONTROLLER
PART – 3 ARRAY & VARIABLE
DEFINE STRING INSIDE THE CONTROLLER

You might also like