-
app/View/Components/Alert.php
Open in GitHubuse 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'); } }
-
resources/views/shared/alerts.blade.php
Open in GitHub@if (Session::has('success')) <x-alert type="success" :dismissible="true"> {{ Session::get('success') }} </x-alert> @endif @if (Session::has('errors')) <x-alert type="danger" :dismissible="true"> @if ($errors->count() > 1) {{ trans_choice('validation.errors', $errors->count()) }} <ul> @foreach($errors->all() as $error) <li>{{ $error }}</li> @endforeach </ul> @else {{ $errors->first() }} @endif </x-alert> @endif
-
resources/views/comments/_form.blade.php
Open in GitHub@auth <comment-form :post-id="{{ $post->id }}" placeholder="@lang('comments.placeholder.content')" button="@lang('comments.comment')"> </comment-form> @else <x-alert type="warning"> @lang('comments.sign_in_to_comment') </x-alert> @endauth