Framework: Be able to generate views from the command line ?

Created on 28 Jul 2016  Â·  12Comments  Â·  Source: laravel/framework

Hello everyone,

I am busy creating a base system for our company and just started creating the controllers and models.
Now I know normally I would not be able to create views from the command line.
But is it an option to intergrate it in a like this :

php artisan make:view filename --path="path.to.file"

Please let me know if this is a option to intergrate or not.
I am kinda new to contributing to opensource.

Best regards,
Wouter.

Most helpful comment

it has been proposed before and closed.

while I maybe came off super anti view command in the last post, it doesn't really matter to me either way. it's such a trivial thing that it just becomes a bikeshedding.

All 12 comments

And I can call it in the same way ?

Like this,

php artisan make:view admin/auth/login

it will create resources/views/admin/auth/login.blade.php.

Awesome that is what I need :)
Thank you !

Decided to reopen to see if there is any change that this can be placed into the core.

It adds to the workflow of artisan in my opinion.
If i am busy creating a lot of boilerplate Stuff and know it will also need to have a View in can create one directly in the terminal.

Instead of switching to my code editor.

I guess we could use a default command for creating blade views, maybe also with some commands to populate the file like:

//Creates a base view with stacks for styles and scripts and a content section for extending purposes.
php artisan make:view --bootstrap main.blade.php

//Creates a view and extends another.
php artisan make:view index.blade.php -extends main -section content -push css js

Something like that but with a better syntax?
This would be useful, if we will just create empty views there's no point on adding this new feature IMO.

it has been proposed before and closed.

while I maybe came off super anti view command in the last post, it doesn't really matter to me either way. it's such a trivial thing that it just becomes a bikeshedding.

There's no default view, it's not like a controller that has a default structure, you can create your views however you desire so i guess it would be hard and maybe useless to come out with a default syntax for going along with the artisan make command.

Maybe that is the case but wouldn't there be a middleway ?

I liked the idea to create extends and maybe insert content sections.

I know it can be trivial but then again why not give the options to create Basic views.
If it trivial it is Just as easy to throw it in since it does conform the workflow in the commandline.

If the command creates only empty views you can 'touch' the file instead of php artisan make:view.
It would make sense using a command if it creates some kind of default view, maybe a copy of welcome.blade.php (make:auth)...

I agree but why not create that option so you can create a file that extends and holds a number of sections ?
Maybe even create a base app View file.I think it will be usefull to some People and i agree Touch is possible to.But i would rather see artisan do it for me.

-------- Oorspronkelijk bericht --------
Van: sede2 [email protected]
Datum: 29-07-2016 12:12 (GMT+01:00)
Aan: laravel/framework [email protected]
Cc: Wouter van Marrum wouter.van.[email protected], State change [email protected]
Onderwerp: Re: [laravel/framework] Be able to generate views from the command
line ? (#14517)

If the command creates only empty views you can 'touch' the file instead of php artisan make:view.

It would make sense using a command if it creates some kind of default view, maybe a copy of welcome.blade.php (make:auth)...

—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or mute the thread.

Closing since it's not a bug report, you can continue discussions on the https://github.com/laravel/internals repo though.

Was this page helpful?
0 / 5 - 0 ratings