Create Laravel views (blade template) using 'php artisan' command-line interface

Overview

About LaraBit

Have you ever wonder to create Laravel views (Blade Templates) using the same type of artisan commands that you usually use to create new controllers, models and migrations etc.

LaraBit extends the power of Laravel Artisan tool and give you the command line interface to create new blade templates really easy.

Installation

install it with composer

composer require furious-developer/lara-bit

Getting Started

Create new blade template:

To create new blade template at the root of the view folder use the command mention below.

php artisan make:view <NameOfTheTemplate>

Example:

if we want to create the "index.blade.php" inside the view folder then use this command and just specify the file name without any file extension.

php artisan make:view index

This command will create the index.blade.php file inside view folder and LaraBit will also output the Absolute Path of the file on the console.

Define template type option:

LaraBit comes with 2 type of Templates

  • basic (Default Type) : It will generate the template with basic HTML code.
  • advance : It will generate the template with HTML code and also include some useful HTML tags as well.

commands:

php artisan make:view index1 --type basic

---- or ----

php artisan make:view index2 --type advance

or use shortcut

php artisan make:view index3 -t basic

---- or ----

php artisan make:view index4 -t advance

Create new Blade Template inside Single/Multiple Folders

In order to create new blade template inside folder prefix the filename with the folder name and dot (.)

LaraBit use the same syntax that view() function use to call a view.

php artisan make:view layout.index

-- define more folder lavel in same way

php artisan make:view folder1.folder2.index

If the Folder doesn't exists then It will create the new Folder(s). If you receive any error after running the above command then change the file permission of the views folder or Manually create the require folders and then run the command again.

Modify Templates

Sometimes we wish to Modify the templates that comes with the LaraBit. we can easily do that by follow the bellow steps.

run this command

php artisan vendor:publish

Then find the line mention below on the console and press the number that is written in-front of it

Provider: FuriousDeveloper\LaraBit\LaraBitServiceProvider

It will generate the basic.blade.php and advance.blade.php inside the "\resources\views\vendor\larabit" folder. Modify the template as per your requirements.

Add & Use Custom Templates

Sometimes we wish to use our own templates instead of using the templates that comes with LaraBit.

Follow the Modify Template Steps then inside "\resources\views\vendor\larabit" place your blade template that you want to use.

Example:

if we wanted to use example.blade.php then we have to place/create this template inside "\resources\views\vendor\larabit" folder then to generate new blade file using your template use the command mention below.

php artisan make:view index6 --type example

---- or ----

php artisan make:view index7 -t example
You might also like...
πŸ“ Artisan Menu - Use Artisan via an elegant console GUI
πŸ“ Artisan Menu - Use Artisan via an elegant console GUI

πŸ“ Artisan Menu Use Artisan via an elegant console GUI Features Run built-in and custom Artisan commands from a console GUI Prompts to enter required

πŸ“ Artisan Menu - Use Artisan via an elegant console GUI
πŸ“ Artisan Menu - Use Artisan via an elegant console GUI

πŸ“ Artisan Menu Use Artisan via an elegant console GUI Features Run built-in and custom Artisan commands from a console GUI Prompts to enter required

A Laravel Artisan SQL Interactive Interface
A Laravel Artisan SQL Interactive Interface

sqli A Laravel 4 & 5 Artisan SQL Interactive Interface, plus a handful of Artisan commands to execute SQL queries. sqli It's like tinker for SQL, just

This package is to add a web interface for Laravel 5 and earlier Artisan.
This package is to add a web interface for Laravel 5 and earlier Artisan.

Nice Artisan This package is to add a web interface for Laravel 5 and earlier Artisan. Installation Add Nice Artisan to your composer.json file : For

πŸ“¦ Adds Laravel Packages Support to Lumen and Vendor Publish Artisan Command.
πŸ“¦ Adds Laravel Packages Support to Lumen and Vendor Publish Artisan Command.

Laravel Package Support for Lumen: Makes Lumen compatible with Laravel Packages. You can use any Laravel Packages in Lumen by installing Larasupport Package.

Generate services in Laravel with the artisan command
Generate services in Laravel with the artisan command

Laravel Service Generator Quickly generate services for your projects! Table of Contents Features Installation Usage Generate services Generate servic

Generate services and contracts in Laravel with the artisan command
Generate services and contracts in Laravel with the artisan command

What does it do? This package adds a new php artisan make:service {name} {--N|noContract} command. It will create a service file and its contract (int

This package provides you with a simplistic `php artisan make:user` command

Laracademy Generators Laracademy make:user Command - provides you with a simplistic artisan command to generate users from the console. Author(s): Lar

Stash view is a composer package for Laravel which caches views using Russian Doll Caching methodology.
Stash view is a composer package for Laravel which caches views using Russian Doll Caching methodology.

Stash View Stash view is a composer package for Laravel which caches views using Russian Doll Caching methodology. What is Russian Doll Caching ? It i

Owner
Ragib MRB
Back-End Developer & A Hardcore Programmer, Who Loves to Write Beautiful Code;
Ragib MRB
Blade Snip allows you to use parts of a blade template multiple times. Basically partials, but inline.

Blade Snip Blade Snip allows you to use parts of a blade template multiple times. Basically partials, but inline: <div class="products"> @snip('pr

Jack Sleight 18 Dec 4, 2022
A package that uses blade templates to control how markdown is converted to HTML inside Laravel, as well as providing support for markdown files to Laravel views.

Install Install via composer. $ composer require olliecodes/laravel-etched-blade Once installed you'll want to publish the config. $ php artisan vendo

Ollie Codes 19 Jul 5, 2021
πŸ‘€ Manage your views in Laravel projects through artisan

Artisan View This package adds a handful of view-related commands to Artisan in your Laravel project. Generate blade files that extend other views, sc

Sven Luijten 842 Dec 29, 2022
A package to easily make use of Iconic icons in your Laravel Blade views.

Blade Iconic A package to easily make use of Iconic icons in your Laravel Blade views. For a full list of available icons see the SVG directory. Iconi

Malik Alleyne-Jones 17 Aug 25, 2022
A package to easily make use of Simple Icons in your Laravel Blade views.

Blade Simple Icons A package to easily make use of Simple Icons in your Laravel Blade views. For a full list of available icons see the SVG directory.

UB Labs 12 Jan 17, 2022
Cagilo - a set of simple components for use in your views Laravel Blade.

Cagilo - a set of simple components for use in your views Laravel Blade. Official Documentation Documentation for Cagilo can be found on its we

Cagilo 151 Dec 6, 2022
A package to easily make use of SVG icons in your Laravel Blade views.

Blade Icons A package to easily make use of SVG icons in your Laravel Blade views. Originally "Blade SVG" by Adam Wathan. Turn... <!-- camera.svg -->

Blade UI Kit 1.7k Jan 2, 2023
A package to easily make use of Iconsax in your Laravel Blade views.

Blade Iconsax A package to easily make use of Iconsax in your Laravel Blade views. This package contains 1.000 icons in 6 diferent styles, a total of

Guilherme Saade 4 Oct 22, 2022
An artisan command for using multiple environment configurations in Laravel 5

Laravel 5 env An artisan command for managing multiple .env of your Laravel 5 app. Installation Copy EnvCommand.php to app/Console/Commands/ of your L

Tommy Ku 18 Nov 29, 2022
A Laravel Code Generator based on your Models using Blade Template Engine

Laravel Code Generator is a PHP Laravel Package that uses Blade template engine to generate code for you. The difference between other code generators

Victor Yoalli 59 Dec 5, 2022