Creating a plain controller in Laravel5

When we have to create a controller in laravel 5, we use command

php artisan make:controller YourController

but the above command will create controller with some default methods like index, show, edit, store. In order to create a controller from scratch without all these default methods, we may use — plain switch with create controller command like :

C:\wamp\www\laravel>php artisan make:controller YourController --plain

This will generate a empty controller, code of the controller will be:

Example

<?php namespace App\Http\Controllers;

use App\Http\Requests;
use App\Http\Controllers\Controller;

use Illuminate\Http\Request;

class YourController extends Controller {

	//

}
Share

You may also like...