Example of Blade components in guillaumebriday/laravel-blog

File app/View/Components/Alert.php (link to Github)
use Illuminate\View\Component;
use Illuminate\View\View;

class Alert extends Component
    public string $type;
    public ?string $dismissible;

    public function __construct(string $type, string $dismissible = null)
        $this->type = $type;
        $this->dismissible = $dismissible;

    public function render(): View
        return view('components.alert');
File resources/views/shared/alerts.blade.php (link to Github)
@if (Session::has('success'))
    <x-alert type="success" :dismissible="true">
        {{ Session::get('success') }}

@if (Session::has('errors'))
    <x-alert type="danger" :dismissible="true">
        @if ($errors->count() > 1)
            {{ trans_choice('validation.errors', $errors->count()) }}
                @foreach($errors->all() as $error)
                    <li>{{ $error }}</li>
            {{ $errors->first() }}
File resources/views/comments/_form.blade.php (link to Github)
      :post-id="{{ $post->id }}"
  <x-alert type="warning">

Additional resources on blade components: