Hakim
Hakim

Reputation: 3437

Laravel 4 - How to generate a controller with its methods

I'm using Jeffrey Way Generator to generate my controller, but in Laravel 4's version, I cant find a way to generate a controller with its list of methods.

This command: php artisan generate:controller, gives me a controller with a predefined template, but I want to declare these methods on my own.

Upvotes: 1

Views: 10922

Answers (2)

Mahendra Jella
Mahendra Jella

Reputation: 5596

Go to the project route directory in Command prompt

cd c:\xampp\htdocs\ProjectName

then run the command php artisan controller:make XYZController

like this

c:\xampp\htdocs\ProjectName>php artisan controller:make XYZController

now it will creates a controller with the name XYZController.php in your Controllers folder i.e

c:\xampp\htdocs\ProjectName\app\controllers\XYZController.php

njoy!!.

Upvotes: 5

J.T. Grimes
J.T. Grimes

Reputation: 4272

Looking at the source, it doesn't appear that the Generator package currently does this. You might send a feature request: https://github.com/JeffreyWay/Laravel-4-Generators/issues

Upvotes: 2

Related Questions