Creating Laravel Blade Component: Step-By-Step

Creating Laravel Blade Component: Step-By-Step

Laravel Daily

11 месяцев назад

24,056 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Tresor kasenda
Tresor kasenda - 17.08.2023 22:35

in the case whe we replace $timezones per models how can we displays all data ????????

Ответить
Mahmoud Reda
Mahmoud Reda - 14.07.2023 23:05

what is the name of the extension that type ["view:", "var_name:"] in -> "return view( view: 'auth.register', compact( var_name: 'timezones'));?

Ответить
Luis Scura
Luis Scura - 01.07.2023 00:00

Simple and heplful :)
Greetings from Arrgentina!

Ответить
Missouri
Missouri - 30.06.2023 10:49

thank you 💚

Ответить
Kushal Gupta
Kushal Gupta - 26.06.2023 11:57

Please update your browser...🙏🙏🙏

Ответить
Birds House
Birds House - 26.06.2023 00:17

More on this topic Teacher, please!

Ответить
Vinicius
Vinicius - 25.06.2023 20:34

It's not better to use Vue components instead?

Ответить
Raysierer
Raysierer - 25.06.2023 19:11

Wouldn't the more correct way be to create a component via artisan make:component instead of a simple blade?

Ответить
Muntaser Muttaqi
Muntaser Muttaqi - 25.06.2023 16:32

@props(['options' => [], 'selected' => null, 'key' => 'id', 'value_key' => 'title', 'default' => 'Select...', 'disabled' => false])

<select {{ $disabled ? 'disabled' : '' }} {!! $attributes->merge([
'class' => 'border-gray-300 dark:border-gray-700
dark:bg-gray-900 dark:text-gray-300 focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500
dark:focus:ring-indigo-600 rounded-md shadow-sm mt-1 block w-full',
]) !!}>
<option value="">{{ $default }}</option>
@foreach ($options as $option)
<option {{ $selected && $selected == $option[$key] ? 'selected' : '' }} value="{{ $option[$key] }}">
{{ $option[$value_key] }}
</option>
@endforeach
</select>

This is how my component looks like...

Ответить
pedram katanchi
pedram katanchi - 25.06.2023 13:26

Please make a video on how to start an Event/Method after a resource has been completely saved including it's relationships.

Ответить
Gergely Csermely
Gergely Csermely - 25.06.2023 12:24

Thanks

Ответить
Matthew Johnson
Matthew Johnson - 25.06.2023 12:17

it is good to refresh on basic aspects of laravel too, blade components is a good one

Ответить
Mahmud Suleman Sheikh Wunnam
Mahmud Suleman Sheikh Wunnam - 25.06.2023 11:40

Thank you for the efforts you put in making these videos. I'd would be great to show how to use the @old and @select to retain the selected value when the validation fails.

Ответить
Rıza Han YILMAZ
Rıza Han YILMAZ - 25.06.2023 11:13

I began following you based on a friend's recommendation. Although my English skills are not proficient, your explanations are so clear, detailed, and step-by-step that I don't even need to rely on automatic translation. I can understand everything very clearly. Thank you!

Ответить
Chalew Tesfaye
Chalew Tesfaye - 25.06.2023 10:59

Thank you

Ответить
Tamim Ikbal
Tamim Ikbal - 25.06.2023 08:48

Sir, I have a question.
In Laravel validation can we stripe tags?
Case: I have build a application where I provide api. so I don’t have blade template. We can escape html and script tags in blade like {{}} this.
As, I have to give response in api, So i don't want to save html and script tag in database.

Is laravel has any solution for this.

Or In this case what will be your steps?

Ответить
Vcode V
Vcode V - 25.06.2023 08:10

It was very useful!!!! thanks!

Ответить