PHP code example of pboivin / laravel-blade-bind-attributes

1. Go to this page and download the library: Download pboivin/laravel-blade-bind-attributes library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

pboivin / laravel-blade-bind-attributes example snippets


class Header extends Component
{
    public function __construct(
        public $title = 'Hello',
        public $secondaryTitle = 'World'
    ){}

    public function render()
    {
        return view('components.header');
    }
}
blade
@props([
    'title',
    'secondaryTitle',
])

<div {{ $attributes }}>
    <h1>{{ $title }}</h1>
    <h2>{{ $secondaryTitle }}</h2>
    {{-- ... --}}
</div>