DeveloperBreeze

Related Posts

More content you might like

Tutorial
php

Creating Custom Blade Components and Directives

In app/View/Components/Button.php:

   namespace App\View\Components;

   use Illuminate\View\Component;

   class Button extends Component
   {
       public $type;
       public $label;

       public function __construct($type = 'primary', $label = 'Submit')
       {
           $this->type = $type;
           $this->label = $label;
       }

       public function render()
       {
           return view('components.button');
       }
   }

Nov 16, 2024
Read More

Discussion 0

Please sign in to join the discussion.

No comments yet. Be the first to share your thoughts!