All Projects → rezaamini-ir → laravel-easyblade

rezaamini-ir / laravel-easyblade

Licence: MIT license
Create an easier & readable Blade (view) in Laravel with EasyBlade

Programming Languages

PHP
23972 projects - #3 most used programming language
Blade
752 projects

Projects that are alternatives of or similar to laravel-easyblade

Laravel Blade Directives
A collection of nice Laravel Blade directives
Stars: ✭ 813 (+1170.31%)
Mutual labels:  blade, laravel-package
laravel-blade-phpstorm-live-template
PhpStorm Live Templates for Laravel Templates (Blade)
Stars: ✭ 32 (-50%)
Mutual labels:  blade, laravel-blade
Laravel Bootstrap Components
Bootstrap components as Laravel components
Stars: ✭ 190 (+196.88%)
Mutual labels:  blade, laravel-package
Laravel Notify
Flexible Flash notifications for Laravel
Stars: ✭ 787 (+1129.69%)
Mutual labels:  blade, laravel-package
Laravel Ui Coreui
Laravel UI Frontend Preset for CoreUI V3.
Stars: ✭ 56 (-12.5%)
Mutual labels:  blade, laravel-package
Laravel Ui Adminlte
Laravel UI Frontend Preset for AdminLTE with Laravel Fortify support.
Stars: ✭ 98 (+53.13%)
Mutual labels:  blade, laravel-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 (+209.38%)
Mutual labels:  blade, laravel-package
query-filter
Define filters for your Eloquent models based on your request
Stars: ✭ 20 (-68.75%)
Mutual labels:  laravel-package
laravel-hyperpay
Laravel package for Hyperpay payment gateway in MENA.
Stars: ✭ 14 (-78.12%)
Mutual labels:  laravel-package
laravel-twig
Twig for Laravel Framework
Stars: ✭ 16 (-75%)
Mutual labels:  laravel-package
laravel-php-k8s
Just a simple port of renoki-co/php-k8s for easier access in Laravel
Stars: ✭ 71 (+10.94%)
Mutual labels:  laravel-package
tall-toasts
A Toast notification library for the Laravel TALL stack. You can push notifications from the backend or frontend to render customizable toasts with almost zero footprint on the published CSS/JS 🔥🚀
Stars: ✭ 296 (+362.5%)
Mutual labels:  laravel-package
lost-in-translation
Uncover missing translations and localization strings in Laravel applications.
Stars: ✭ 32 (-50%)
Mutual labels:  laravel-package
eloquent-repository
Repository pattern for Eloquent ORM with focus in cache.
Stars: ✭ 30 (-53.12%)
Mutual labels:  laravel-package
laravel-sri
Subresource Integrity (SRI) package for Laravel
Stars: ✭ 24 (-62.5%)
Mutual labels:  laravel-package
qqmap-region
腾讯位置服务中国标准行政区划数据 SDK
Stars: ✭ 22 (-65.62%)
Mutual labels:  laravel-package
laravel-viva-payments
A Laravel package for integrating the Viva Payments gateway
Stars: ✭ 29 (-54.69%)
Mutual labels:  laravel-package
freechat
🐶 online anonymous chat application.
Stars: ✭ 31 (-51.56%)
Mutual labels:  blade
laravel-pagetitle
Laravel package for managing page titles in blade views
Stars: ✭ 19 (-70.31%)
Mutual labels:  blade
canvas
Code Generators for Laravel Applications and Packages
Stars: ✭ 139 (+117.19%)
Mutual labels:  laravel-package

Scrutinizer Code Quality Build Status

laravel EasyBlade

You can create a simpler and more readable view with EasyBlade

Installation

composer require rezaamini-ir/laravel-easyblade

Usage

Using EasyBlade is, just like its name, super easy!

Imagine that you want to write a route URL in a href in Blade You will have to write this code :

    <a href="{{ route('home') }}"></a>

But by using EasyBlade, Just write :

    <a href="@route('home')"></a>

and don't use "{{ }}" or any pure PHP code

Blade template engine was not created for pure PHP code, rather, it was created to code easier. You can pass it by EasyBlade

Current Directives :

  • @asset('foo')
  • @url('foo')
  • @route('foo')
  • @isActive('routeName', 'active', 'deactive')
  • @count(array|collection, number )
  • @user(attr)
  • @sessionExists('name')
  • @session('name')
  • @image('address', 'cssClasses')
  • @style('style.css')
  • @script('script.js')
  • @config('app.name', 'Laravel')
  • @old('name', 'Reza')

Features :

  • You can pass a route name or array of route names as first parameters to@isActive directive , second parameter is a string which you want to echo in view and third parameter is an optional param and it will return a null string if nothing was passed , It will be showed when the current route is not equal to array or string which passed as first param
  • You can use @count directive instead of writing lots of if statements to check if the count of the collection or array is equal to or greater than your number which was passed to the second param.

Examples :

  • @count
    @count([1, 2, 3], 3)
        something
    @endcount
    // return `something` because count of array is equal 3
    @count([1, 2], 3)
        true
    @endcount
    // return null because count of array is smaler than 3
  • @isActive Imagine current route is : dashboard.home
    @isActive('dashboard.home', 'active', 'deactive')
    // Return : active
    @isActive(['dashboard.home', 'dahboard.profile'], 'active', 'deactive')
    // Return : active
    @isActive('home', 'active', 'deactive')
    // Return : deactive
  • @asset
    @asset('img/header.png')
    
    // Return : http://127.0.0.1/img/header.png (Like asset() helper )
  • @route
    @route('dashboard')
    
    // Return : http://127.0.0.1/dashboard (Like route('routeName') helper )
  • @url
    @url('/home')
    
    // Return : http://127.0.0.1/home (Like url('address') helper )
  • @user
    @user('name')
    
   // It will run auth()->user()->name and return user's name
   // You don't need to check user is authenticated or not , it will check by itself
  • @sessionExists
    @sessionExists('foo')
        Session Exists
    @endsessionExists
    
    // It will run session()->exists('foo') in a condition
  • @session
    @session('name')
    
    // First it will check session exists then it will print value of session 
  • @image
    @image('img/img1.png', 'img-fuild rounded-circle')
    
    // Return a img tag with http://domain/img/img1.png file and 'img-fuild rounded-circle' class
  • @old
    @old('name', $user->name)
    
    // Return something like : {{ old('name', $user->name) }}
  • @script
    @script('/js/script.js')
    // Return script tag : <script src="/js/script.js"></script>
      
    @script('/js/script.js', true) // Second and third parameter is optional
    // Return script tag with defer : <script src="/js/script.js" defer></script>  
  • @style
    @style('/css/app.css')
    // Return link tag : <link rel="stylesheet" href="/css/app.css">
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].