2017 © Pedro Peláez
 

library artisan-view

Manage your views in Laravel projects through artisan

image

sven/artisan-view

Manage your views in Laravel projects through artisan

  • Sunday, June 3, 2018
  • by svenluijten
  • Repository
  • 30 Watchers
  • 391 Stars
  • 46,705 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 60 Forks
  • 2 Open issues
  • 27 Versions
  • 11 % Grown

The README.md

artisan-view, (*1)

Artisan View

Latest Version on Packagist Total Downloads ![Software License][ico-license] ![Build Status][ico-build] StyleCI, (*2)

[!WARNING] This package has been abandoned. The make:view command is a part of Laravel since v10.23.0, you should use that instead. You will still be able to install this package when using Laravel versions before v10.23.0., (*3)

This package adds a handful of view-related commands to Artisan in your Laravel project. Generate blade files that extend other views, scaffold out sections to add to those templates, and more. All from the command line we know and love!, (*4)

Index

Installation

You'll have to follow a couple of simple steps to install this package., (*5)

Downloading

Via composer:, (*6)

composer require sven/artisan-view --dev

Registering the service provider

If you're using Laravel 5.5 or above, you can skip this step. The service provider will have already been registered thanks to auto-discovery., (*7)

Otherwise, register Sven\ArtisanView\ServiceProvider::class manually in your AppServiceProvider's register method:, (*8)

public function register()
{
    if ($this->app->environment() !== 'production') {
        $this->app->register(\Sven\ArtisanView\ServiceProvider::class);
    }    
}

Usage

If you now run php artisan you will see two new commands in the list: - make:view - scrap:view, (*9)

Creating views

# Create a view 'index.blade.php' in the default directory
$ php artisan make:view index

# Create a view 'index.blade.php' in a subdirectory ('pages')
$ php artisan make:view pages.index

# Create a view with a different file extension ('index.html')
$ php artisan make:view index --extension=html

Extending and sections

# Extend an existing view
$ php artisan make:view index --extends=app

# Add a section to the view
$ php artisan make:view index --section=content

# Add multiple sections to the view
$ php artisan make:view index --section=title --section=content

# Add an inline section to the view
# Remember to add quotes around the section if you want to use spaces
$ php artisan make:view index --section="title:Hello world"

# Create sections for each @yield statement in the extended view
$ php artisan make:view index --extends=app --with-yields

# Add @push directives for each @stack statement in the extended view
$ php artisan make:view index --extends=app --with-stacks

REST resources

# Create a resource called 'products'
$ php artisan make:view products --resource

# Create a resource with only specific verbs
$ php artisan make:view products --resource --verb=index --verb=create --verb=edit

Scrapping views

# Remove the view 'index.blade.php'
$ php artisan scrap:view index

# Remove the view by dot notation
$ php artisan scrap:view pages.index

This will ask you if you're sure. To skip this question, pass the --force flag:, (*10)

# Don't ask for confirmation
$ php artisan scrap:view index --force

Scrapping a REST resource

# Remove the resource called 'products'
$ php artisan scrap:view products --resource

This will remove the views products.index, products.show, products.create, and products.edit. If the directory products/ is empty after doing that, it will also be deleted., (*11)

You can scrap part of a resource by adding --verb flags:, (*12)

# Remove the 'products.create' and 'products.edit' views.
$ php artisan scrap:view products --resource --verb=create --verb=edit

Mix and match

Of course, all the options work well together like you'd expect. So the following command..., (*13)

$ php artisan make:view products --resource --extends=app --section="title:This is my title" --section=content

... will put the following contents in products/index.blade.php, products/edit.blade.php, products/create.blade.php, and products/show.blade.php:, (*14)

@extends('app')

@section('title', 'This is my title')

@section('content')

@endsection

Contributing

All contributions (in the form on pull requests, issues and feature-requests) are welcome. See the contributors page for all contributors., (*15)

License

sven/artisan-view is licenced under the MIT License (MIT). Please see the license file for more information., (*16)

The Versions

03/06 2018

dev-master

9999999-dev

Manage your views in Laravel projects through artisan

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel blade artisan templates views

09/02 2018

v3.0.0

3.0.0.0

Manage your views in Laravel projects through artisan

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel blade artisan templates views

19/01 2018

v2.1.0

2.1.0.0

Manage your views in Laravel projects through artisan

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel blade artisan templates views

11/01 2018

2.0.3

2.0.3.0

Manage your views in Laravel projects through artisan

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel blade artisan templates views

14/10 2017

2.0.2

2.0.2.0

Manage your views in Laravel projects through artisan

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel blade artisan templates views

15/09 2017

2.0.1

2.0.1.0

Manage your views in Laravel projects through artisan

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel blade artisan templates views

09/09 2017

1.0.x-dev

1.0.9999999.9999999-dev

Manage your views in Laravel projects through artisan

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel artisan templates views

09/09 2017

2.0.0

2.0.0.0

Manage your views in Laravel projects through artisan

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel blade artisan templates views

05/09 2017

2.0.0-beta3

2.0.0.0-beta3

Manage your views in Laravel projects through artisan

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel blade artisan templates views

02/09 2017

2.0.0-beta2

2.0.0.0-beta2

Manage your views in Laravel projects through artisan

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel blade artisan templates views

01/09 2017

2.0.0-beta1

2.0.0.0-beta1

Manage your views in Laravel projects through artisan

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel blade artisan templates views

30/08 2017

2.0.x-dev

2.0.9999999.9999999-dev

Manage your views in Laravel projects through artisan

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel blade artisan templates views

30/08 2017

v1.3.4

1.3.4.0

Manage your views in Laravel projects through artisan

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel artisan templates views

19/06 2017

1.3.3

1.3.3.0

Manage your views in Laravel projects through artisan

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel artisan templates views

02/02 2017

1.3.2

1.3.2.0

Manage your views in Laravel projects through artisan

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel artisan templates views

02/09 2016

1.3.1

1.3.1.0

Manage your views in Laravel projects through artisan

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel artisan templates views

16/06 2016

1.3.0

1.3.0.0

Manage your views in Laravel projects through artisan

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel artisan templates views

03/06 2016

1.2.3

1.2.3.0

Manage your views in Laravel projects through artisan

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel artisan templates views

01/05 2016

1.2.2

1.2.2.0

Manage your views in Laravel projects through artisan

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel artisan templates views

01/05 2016

1.2.1

1.2.1.0

Manage your views in Laravel projects through artisan

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel artisan templates views

01/05 2016

1.2.0

1.2.0.0

Manage your views in Laravel projects through artisan

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel artisan templates views

22/04 2016

1.1.2

1.1.2.0

Manage your views in Laravel projects through artisan

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel artisan templates views

19/04 2016

1.1.1

1.1.1.0

Manage your views in Laravel projects through artisan

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel artisan templates views

14/04 2016

1.1.0

1.1.0.0

Manage your views in Laravel projects through artisan

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel artisan templates views

12/04 2016

1.0.1

1.0.1.0

Manage your views in Laravel projects through artisan

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel artisan templates views

12/04 2016

1.0.0

1.0.0.0

Manage your views in Laravel projects through artisan

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel artisan templates views

12/04 2016

0.0.1

0.0.1.0

Manage your views in Laravel projects through artisan

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel artisan templates views