Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

types of controller in laravel

-types of controller:
	-basic controller
		-php artisan make:controller basicController
		-Route: Route::get('about',[basicController::class,'about']);
	-single action controller	(handle single action)
		public function __invoke(){//inbuilt}
		-php artisan make:controller singleActionController --invokable
		-Route::get('course',singleActionController::class); //it will invoke only one function
	-resource controller (CRUD functions)
		-Route::resource('photo',photoController::class);  //invoke index function
			
 
PREVIOUS NEXT
Tagged: #types #controller #laravel
ADD COMMENT
Topic
Name
4+1 =