2017 © Pedro Peláez
 

library artisan-make-view

Create views, including "resource" views, using console commands.

image

bencomeau/artisan-make-view

Create views, including "resource" views, using console commands.

  • Friday, September 8, 2017
  • by bencomeau
  • Repository
  • 0 Watchers
  • 2 Stars
  • 70 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 52 % Grown

The README.md

Laravel View Generator

Introduction

Quickly create views and view resources from the Artisan console, saving a surprising amount of time., (*1)

Code Samples

Creating views is as easy as:, (*2)

php artisan make:view user  // creates --> index, create, show, edit views in the resources/views/user directory

php artisan make:view user.index  // creates --> resources/views/user/index.blade.php

Using something other than blade templates?, (*3)

php artisan make:view user.index -e twig  // creates --> resources/views/index.twig

Want to use a view path you specified in config/view.php?, (*4)

// If your config/view file looks like this:
'paths' => [
    resource_path('views'),
    resource_path('my-custom-view-folder')
],

// Then just pass the key you want to use, like this:
php artisan make:view user.index -p 1  // creates --> resources/my-custom-view-folder/index.blade.php

Install

To get started, use composer to require this package:, (*5)

composer require bencomeau/artisan-make-view --dev

Then simply register the package's Service Provider in your app/Providers/AppServiceProvider.php file:, (*6)

Note: Laravel 5.5 and above uses Package Auto-Discovery; if you are using Laravel >= 5.5 it is not necessary to manually add the service provider as shown below., (*7)

public function register()
{
    if ($this->app->environment('local')) {
        $this->app->register(\BenComeau\ArtisanMakeView\ArtisanMakeViewServiceProvider::class);
    }
}

And you're ready to quickly generate views!, (*8)

Usage

To list all command options, (*9)

php artisan make:view --help

Make a single view by name, in dot notation, (*10)

php artisan make:view user.index

Make a view resource by passing just the name of the resource, (*11)

php artisan make:view user -r

Make a view with a custom extension, (*12)

php artisan make:view user.index -e twig

Make a view and store it in another directory Note: -p 1 refers to the value of array key of 1 in your config('view.paths') setting., (*13)

php artisan make:view user.index -p 1

Combine multiple options to fully-customize the view(s) being created Note: this will create all resource views in your custom directory, with the twig extension., (*14)

php artisan make:view user -r -p 1 -e twig

License

Artisan Make View is open-sourced software licensed under the MIT license., (*15)

The Versions

08/09 2017

dev-master

9999999-dev

Create views, including "resource" views, using console commands.

  Sources   Download

MIT

The Requires

  • php >=5.6.4

 

by Ben Comeau

laravel artisan

08/09 2017

dev-develop

dev-develop

Create views, including "resource" views, using console commands.

  Sources   Download

MIT

The Requires

  • php >=5.6.4

 

by Ben Comeau

laravel artisan

08/09 2017

v1.1

1.1.0.0

Create views, including "resource" views, using console commands.

  Sources   Download

MIT

The Requires

  • php >=5.6.4

 

by Ben Comeau

laravel artisan

16/03 2017

v1.0

1.0.0.0

Create views, including "resource" views, using console commands.

  Sources   Download

MIT

The Requires

  • php >=5.6.4

 

by Ben Comeau

laravel artisan