Это видео недоступно.
Сожалеем об этом.
Creating Laravel Blade Component: Step-By-Step
HTML-код
- Опубликовано: 23 июн 2023
- Let's take an example Blade component x-text-input from Laravel Breeze and create a new similar one x-input-select.
Official docs: laravel.com/docs/10.x/blade#c...
Full course lesson "User Timezone in Registration": laraveldaily.com/lesson/larav...
- - - - -
Support the channel by checking out my products:
- My Laravel courses: laraveldaily.com/courses
- Laravel QuickAdminPanel: quickadminpanel.com
- Livewire Kit Components: livewirekit.com
- - - - -
Other places to follow:
- My weekly Laravel newsletter: us11.campaign-archive.com/hom...
- My personal Twitter: / povilaskorop
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!
From Indonesia?
it is good to refresh on basic aspects of laravel too, blade components is a good one
Thank you. I was following a linked in course and the aspect of setting up the carrying of attributes was not delved into. Seeing your solution helped me to understand 🙏
Simple and heplful :)
Greetings from Arrgentina!
Amazing tutorial, thank you!
this man is simply incredible!!!! tks Povilas Korop
It was very useful!!!! thanks!
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.
Something to consider, adding to my to-do list.
thank you 💚
Thank you
When u doing something looks so cool and things working as i want. But i don't understand and i need to check another tutorial. I don't know, maybe i'm stupid.
Thanks for the video.
Thanks
in the case whe we replace $timezones per models how can we displays all data ????????
Is it possible for dynamic event if selected option is chosen? i.e opt1 is selected show dynamic inputs
That would require JavaScript or Livewire
what is the name of the extension that type ["view:", "var_name:"] in -> "return view( view: 'auth.register', compact( var_name: 'timezones'));?
It's phpstorm by default
Please make a video on how to start an Event/Method after a resource has been completely saved including it's relationships.
Not sure what is the problem there. In Controller, after calling save() or create() on model, dispatch the Event. Search for events/listeners on my channel.
Wouldn't the more correct way be to create a component via artisan make:component instead of a simple blade?
Personal preference
can you do course on youtube for dev ops too?
No, I'm not planning to dive into dev ops any time soon, want to stick to Laravel.
@raman Dev Ops is HUUUGE! It's a job on it's own. I am just dipping my toes into it and it's endless.
Please update your browser...🙏🙏🙏
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?
Not sure I understand what exactly you want to strip, could you provide real example with data for request and response?
@@LaravelDaily Here is the example:
User input:
{
"comment": "alert('hacked')",
}
Validation in laravel:
$request->validate([
'comment'=> ['required','string']
]);
Saved In the database:
Comment::create([
'user_id'=>Auth::id(),
'comment' => $request->input('comment')
']);
Now, the comment will save in the database with the (alert('hacked')) tags, I want to stripe_tags or htmlspecialchars()
Is there laravel has system to do it in validation for example:
$request->validate([
'comment'=> ['required','string','safe']
]);
If not, What will be your approach in this case.
Note: As I mentioned we can prevent it into blade template or we can stripe the tags in api resource response. For this I have to do this manually. So, my case I don't want to save (alert('hacked')) tags in database like this executable. Because, it saved like this maybe hacker can perform XSS attack
Thanks sir
@@bmtamim7818 If you don't want to do it "manually", then I think HTMLPurifier does exactly what you need.
It depends on which level you want to strip.
I would probably do it here in your code:
Comment::create([
'user_id'=>Auth::id(),
'comment' => strip_tags($request->input('comment'))
']);
@@LaravelDaily Thanks a lot sir,
BTW, Laravel daily is a part of my daily life. I was switching much, You are the only reason I am still with laravel and working on some good projects.❤️
It's not better to use Vue components instead?
If you have dynamic behavior for JavaScript then maybe yes