Giter Club home page Giter Club logo

larabit's Introduction

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

larabit's People

Contributors

ragib-mrb avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.