mercredi 23 octobre 2019

Shorten directive in laravel

I'm trying to use laravel component and slot.

As I'm using blade templates under components folder, my blade syntax is something like this

@component('components.button',['data'=>$data]) 
@endcomponent

Here, every times I call it, I have to write the word "component" multiple times. can I shorten it as below?

@component('button',['data'=>$data]) 

If yes, how can I achieve it?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire