Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

rene's avatar
Level 2

Laravel 5 Generators

Hello,

The repo of Laravel-4-Generators there is a note about L5-support: "There is no support for Laravel 5, as the framework now includes a number of generators out of the box."

But what's true about that? Didn't find that generators.

I use Scaffolding always, because it's easy and fast for fast development of small things.

Who know the reason, or a way to use Scaffold.

0 likes
33 replies
michaeldyrynda's avatar

Have a look at the commands prefixed with make: - they're what you're after :)

1 like
mstnorris's avatar

@rene I know what you mean, @JeffreyWay's generators were a real time save. @deringer, in renews question, scaffold was one command compared with many if you were to do them individually.

michaeldyrynda's avatar

Laravel is very separation-of-concerns friendly. You could probably put a small script together that runs all the relevant make commands for you. I didn't use scaffold myself, but I can maybe put something together in a bit after I've had a look at the functionality.

JeffreyWay's avatar

I honestly never used the scaffolding generator. It's cool for party tricks, but that's about it. :)

The only thing I miss is the schema generator from generate:migration. I'm hoping to submit a PR to add that functionality in.

3 likes
mstnorris's avatar

@JeffreyWay would you consider updating your generators package. There is some really useful stuff in there.

2 likes
mstnorris's avatar

I would love to get back seed, pivot, resource and scaffold. I know they're fairly basic but they are time savers and great for getting the little things done.

bashy's avatar

Maybe I'm missing this in the docs/help command somewhere but does generate:controller not have a --path anymore? I used that a lot with L4 Generators since I had folders in the controllers folder...

rene's avatar
Level 2

indeed @mstnorris. @jeffreyway, i always used generate:scaffold, and always told the console yes for each option. So I had a restful controller, including a migration and seed file. and also the views, where i pasted in my own always-the-same-structure :P

1 like
michaeldyrynda's avatar

@bashy it seems everything is relative to app/Http/Controllers in L5.

> php artisan make:controller Bashy\\Controller
> vim app/Http/Controllers/Bashy/BashyController.php
1 like
bashy's avatar

@deringer Thanks for checking that! That's helpful, surprised I didn't think of it myself... so simple. Also creates the namespace, great!

1 like
jekinney's avatar

I miss the pivot command myself. Also when generate:migration without having to add --create cause I'm lazy.

nolros's avatar

@jekinney I'm with you on the pivot and because of my ADD end up screwing up the pivot relations.

1 like
ivanmijatovic89's avatar

@JeffreyWay i use scaffold generators on my last 10 projects, yes they was all small, but with scaffold i finish them really quickly. Can you please update you generators or make separate package only for scaffolding !

I think scaffold is one of the best package out there. It create everything i need, i just make little adjustment after that and i am done !

JeffreyWay's avatar

generate:pivot is definitely pretty convenient. Maybe we could offer something, like:

php artisan make:migration:pivot post tag
5 likes
ossi's avatar

@JeffreyWay It is indeed cool for party tricks and I go to a lot of parties :-) But on a serious note, I do go to a fair number of jams where we put things together in a few hours and that is where I found the scaffold generator an invaluable tool, (well, I did use dollar :-( ). within a couple of minutes I had something presentable. I suppose I could continue using Laravel 4 for jams, but then I would miss the cool features of 5.

bennash's avatar

I came here for the party and yeah seed and pivot generators would be nice.

1 like
hootlex's avatar

Also passing fields to generate:migration was awesome!

RomainLanz's avatar

I will create a new package based on Laravel-4-Generators to put Laravel make command on steroids.

I really like RoR generators, so I will try to port them into Laravel.

martinbean's avatar

@bashy Controllers in Laravel 5 are name-spaced using the PSR-4 standard, so you can specify the path by specifying the corresponding namespace. For example, $ php artisan make:controller Admin\EventController would create a class at the path of app/Http/Controllers/Admin/EventController.php. Also note you need to escape the back slash.

elbakly's avatar

I had the 1.1 version with scaffold modified to edit related model in retrospective manner now i will have to do it for Laravel 5 but its seems much challenging this time as i don't have much of boiler plates like before generate:view it speed development like lightening speed, I only had to write my scaffold then i had a fully running application right there

Next

Please or to participate in this conversation.