how to make controller in laravel

Solutions on MaxInterview for how to make controller in laravel by the best coders in the world

showing results for - "how to make controller in laravel"
Tom
15 Sep 2020
1php artisan make:controller MyController
Ezio
19 Apr 2019
1php artisan make:controller UserController
Inès
07 Aug 2019
1php artisan make:controller ShowProfile
Jazmín
16 Mar 2018
1Simple controller:
2php artisan make:controller nameOfController  
3  
4Want to create controller in a folder? use it like this:
5php artisan make:controller NameOfFolder/nameOfController  
6  
7Resource Controller:This controller will create all CRUD methods
8php artisan make:controller nameOfController --resource
Naelle
21 Nov 2017
1//i want to create dashboard controller
2php artisan make:controller DashboardController
3// if i want to create resourse controller then
4php artisan make:controller Dashboardcontroller -r
5//and also with
6php artisan make:controller Dashboardcontroller --resource
Lea
02 Jan 2017
1Route::get('/{page_name}', [PageController::class, 'getPage'])->name('website.pages');
2
3<?php
4
5namespace App\Http\Controllers;
6
7use Illuminate\Http\Request;
8
9class PageController extends Controller
10{
11    public function getPage($page_name){
12        if(!view()->exists("pages.{$page_name}")){
13            abort(404);
14        }
15        return view("pages.{$page_name}");
16    }
17}
18
similar questions
queries leading to this page
how to make controller in laravel