All Projects β†’ svenluijten β†’ Artisan View

svenluijten / Artisan View

Licence: mit
πŸ‘€ Manage your views in Laravel projects through artisan

Projects that are alternatives of or similar to Artisan View

Comments
Native comments for your Laravel application.
Stars: ✭ 390 (-44.92%)
Mutual labels:  hacktoberfest, laravel, package, blade
Laravel Package Maker
Get a πŸ“¦ skeleton and all other `make` commands from laravel base for package development.
Stars: ✭ 89 (-87.43%)
Mutual labels:  hacktoberfest, laravel, package
Laravel Packager
A cli tool for creating Laravel packages
Stars: ✭ 1,049 (+48.16%)
Mutual labels:  hacktoberfest, laravel, package
Jigsaw
Simple static sites with Laravel’s Blade.
Stars: ✭ 1,823 (+157.49%)
Mutual labels:  hacktoberfest, laravel, blade
Env Providers
πŸ‘· Load Laravel service providers based on your application's environment.
Stars: ✭ 73 (-89.69%)
Mutual labels:  laravel, artisan, package
Blogetc
Easily add a full Laravel blog (with built in admin panel and public views) to your laravel project with this simple package.
Stars: ✭ 198 (-72.03%)
Mutual labels:  laravel, package, blade
Generators
Laravel File Generators with config and publishable stubs
Stars: ✭ 102 (-85.59%)
Mutual labels:  hacktoberfest, laravel, artisan
Flex Env
🌳 Manage your .env file in Laravel projects through artisan
Stars: ✭ 95 (-86.58%)
Mutual labels:  laravel, artisan, package
Nebula
Nebula is a minimalistic and easy to use administration tool for Laravel applications, made with Laravel, Alpine.js, and Tailwind CSS.
Stars: ✭ 190 (-73.16%)
Mutual labels:  hacktoberfest, laravel, package
Laravelpackage.com
Documentation for LaravelPackage.com: Learn to create Laravel specific PHP packages from scratch, following this open documentation.
Stars: ✭ 214 (-69.77%)
Mutual labels:  hacktoberfest, laravel, package
Laravel Craftsman
Laravel Craftsman CLI for easily crafting Laravel assets for any project (artisan make on steroids)
Stars: ✭ 227 (-67.94%)
Mutual labels:  hacktoberfest, laravel, artisan
Laravel Totem
Manage Your Laravel Schedule From A Web Dashboard
Stars: ✭ 1,299 (+83.47%)
Mutual labels:  hacktoberfest, laravel, package
Laravel Messenger
Simple user messaging package for Laravel
Stars: ✭ 2,140 (+202.26%)
Mutual labels:  hacktoberfest, laravel, package
Laravel Acl
This package helps you to associate users with permissions and permission groups with laravel framework
Stars: ✭ 404 (-42.94%)
Mutual labels:  hacktoberfest, laravel, package
Laravel Translatable
A Laravel package for multilingual models
Stars: ✭ 624 (-11.86%)
Mutual labels:  hacktoberfest, laravel, package
Laravel Blade Javascript
A Blade directive to export variables to JavaScript
Stars: ✭ 485 (-31.5%)
Mutual labels:  laravel, blade
Laravel Dompdf
A DOMPDF Wrapper for Laravel
Stars: ✭ 4,978 (+603.11%)
Mutual labels:  hacktoberfest, laravel
Laravel Cascade Soft Deletes
Cascading deletes for Eloquent models that implement soft deletes
Stars: ✭ 498 (-29.66%)
Mutual labels:  laravel, package
Laravel Blade X
Use custom HTML components in your Blade views
Stars: ✭ 538 (-24.01%)
Mutual labels:  laravel, blade
Laravel Medialibrary
Associate files with Eloquent models
Stars: ✭ 4,743 (+569.92%)
Mutual labels:  hacktoberfest, laravel

artisan-view

Artisan View

Latest Version on Packagist Total Downloads Software License Build Status StyleCI

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!

Index

Installation

You'll have to follow a couple of simple steps to install this package.

Downloading

Via composer:

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

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

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

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:

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

You can scrap part of a resource by adding --verb flags:

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

$ 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:

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

License

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].