Skip to content

Instantly share code, notes, and snippets.

@tamkeen-tms
Created August 31, 2016 10:04
Show Gist options
  • Save tamkeen-tms/3790cb1f2669bd44cb53d55207ce1d2c to your computer and use it in GitHub Desktop.
Save tamkeen-tms/3790cb1f2669bd44cb53d55207ce1d2c to your computer and use it in GitHub Desktop.
[laravel] Create a new view file via artisan
Artisan::command('make:view {name}', function(){
file_put_contents(base_path('resources/views/' . $this->argument('name') . '.blade.php'), '');
});
@tamkeen-tms
Copy link
Author

Put these lines in routes/console.logo

Now, using artisan you can create a new view, simply type:

php artisan make:view [file name]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment