Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Be able to generate views from the command line ? #14517

Closed
wotta opened this issue Jul 28, 2016 · 13 comments
Closed

Be able to generate views from the command line ? #14517

wotta opened this issue Jul 28, 2016 · 13 comments

Comments

@wotta
Copy link

wotta commented Jul 28, 2016

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.

@petehouston
Copy link

You can create your own, https://gist.github.com/umefarooq/ebc617dbf88260db1448

@wotta
Copy link
Author

wotta commented Jul 28, 2016

And I can call it in the same way ?

@petehouston
Copy link

petehouston commented Jul 28, 2016

Like this,

php artisan make:view admin/auth/login

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

@wotta
Copy link
Author

wotta commented Jul 28, 2016

Awesome that is what I need :)
Thank you !

@wotta wotta closed this as completed Jul 28, 2016
@wotta wotta reopened this Jul 28, 2016
@wotta
Copy link
Author

wotta commented Jul 28, 2016

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.

@fernandobandeira
Copy link
Contributor

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.

@browner12
Copy link
Contributor

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.

@fernandobandeira
Copy link
Contributor

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.

@wotta
Copy link
Author

wotta commented Jul 28, 2016

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.

@sede2
Copy link

sede2 commented Jul 29, 2016

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)...

@wotta
Copy link
Author

wotta commented Jul 29, 2016

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 notifications@github.com
Datum: 29-07-2016 12:12 (GMT+01:00)
Aan: laravel/framework framework@noreply.github.com
Cc: Wouter van Marrum wouter.van.marrum@concept-core.nl, State change state_change@noreply.github.com
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.

@themsaid
Copy link
Member

themsaid commented Sep 6, 2016

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

@ArslanKathia
Copy link

In laravel 8.x.x the phpartisan make:view auth/login
But gives an error on Command "make:view" is not defined.
I think laravel latest version is no longer supports that command!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants