2017 © Pedro Peláez
 

library with-blade-directive

@with blade directive

image

czim/with-blade-directive

@with blade directive

  • Friday, February 3, 2017
  • by czim
  • Repository
  • 1 Watchers
  • 2 Stars
  • 1,582 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 5 % Grown

The README.md

Blade Directive: @with

![Software License][ico-license], (*1)

A simple blade directive to help clean up your views., (*2)

Instead of doing this elaborate jig:, (*3)

``` blade , (*4)

{{ $model->relation->method()->object->first_name }} {{ $model->relation->method()->object->first_name }} {{ $model->relation->method()->object->email }}

You can clean it up like this: ``` blade @with($model->relation->method()->object as $object) <tr> <td>{{ $object->first_name }}</td> <td>{{ $object->first_name }}</td> <td>{{ $object->email }}</td> </tr>

All this does is assign an expression to a variable., (*5)

Install

Via Composer, (*6)

``` bash $ composer require czim/with-blade-directive, (*7)


Then add the service provider in `config/app.php`: Czim\WithBladeDirective\WithBladeDirectiveServiceProvider::class, ## Usage The `@with` directive supports two formats: ``` blade @with(any_expression($you * $want) as $variableName) @with('variableName', any_expression($you * $want))

These have exactly the same result., (*8)

Credits

License

The MIT License (MIT). Please see License File for more information., (*9)

The Versions

03/02 2017

dev-master

9999999-dev https://github.com/czim/with-blade-directive

@with blade directive

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

dutch singularize pluralize

27/09 2016

1.1.0

1.1.0.0 https://github.com/czim/with-blade-directive

@with blade directive

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

dutch singularize pluralize

27/08 2016

1.0.0

1.0.0.0 https://github.com/czim/with-blade-directive

@with blade directive

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

dutch singularize pluralize

27/08 2016

1.0.1

1.0.1.0 https://github.com/czim/with-blade-directive

@with blade directive

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

dutch singularize pluralize