Laravel Hidden Feature - Responsable Interface - No More Duplicate Code

preview_player
Показать описание
Here, we will be looking at one of the hidden features of Laravel. This hidden feature is Responsable Interface. With the help of this interface, we can remove unwanted duplicate code from the controller.

=== Important Links ===

=== Offer ===

GET ONE MONTH OF FREE CLOUDWAYS HOSTING

Get up to Free Hosting by using code "LARATIPS".

=== Support ===

If you want me to continue making this kind of video for free on YouTube, then you can support the channel

eSewa ID: 9843632084

=== Social Media Links ===

Let's be friends

=== Video Related Links ===

Hidden Laravel Features Playlist

=== Other Videos ===

What's New In Laravel 9

New In Laravel Playlist

Laravel Package Development Playlist

Password Validation In Laravel with at least one Letters, Numbers, Upper and Lowercase or Symbols:

Multiple Apis With ForwardsCalls Trait And Code Refactoring Tip - Laravel Hidden Feature:

Laravel Chunking - You Might Be Doing This Wrong - Problem and Solution:

Laravel Tip - Properly Get Data Between Two Dates

Get Data From Multiple Databases In One Project | Laravel Tip

=== Theme, Font and Extensions I use ===

=== Attribution ===

#laravel #php #laraveltip #laratips
Рекомендации по теме
Комментарии
Автор

GET ONE MONTH OF FREE CLOUDWAYS HOSTING


Cloudways offers peace of mind and flexibility so you can focus on growing your business and reaching new milestones instead of dealing with server management. With Cloudways, you get an optimized stack, managed servers, backups, staging environment, integrated Git, pre-configured, Composer, 24/7 support, and the choice of five cloud providers: AWS, DigitalOcean, Linode, Google Cloud, and Vultr

Laratips
Автор

Thank you for the hidden GEM as always. I am enjoying to visit this channel for this kind of videos everyday. I watch & re-watch these. 👍👍👍🙏

davidsonzed
Автор

I love the way you simplify complicated things 👍

humantruecolors
Автор

Tough Laravel topics usually appear to be simple in this channel. 😊

imrjat
Автор

Excellent video! Thank you 👏 One refinement though is that you speak of the toResponse() method returning the view data. That’s not actually correct. It returns the response itself, which includes the view data as well as the view. That could confuse some viewers. And of course it doesn’t have to return a view. It can return JSON, a model, text, etc. instead.

theceilidhboy
Автор

Instead of having the edit and create actions, I prefer to only have one action called form, which would, in this case, look like the following:

public function form(User $user = null)
{
$roles = Role::get(['id', 'name']);

return view('admin.users.form', [
'user' => $user ?: new User(),
'roles' => $roles
]);
}

With that, I don't have to complicate life with implementing responses

moaishots
Автор

Absolutely loved this video. Amazing work.

Alazuofficial
Автор

You got a new sub 👌. Going to bingewatch all your video’s. Great tips, keep it going!

KaraSuraDraw
Автор

In Router.php Responsable interface isn't implemented using implements. Can you explain that?

majormfr
Автор

yes, this is hidden GEM.
very nice! will try it

bboydarknesz
Автор

It's good idea but you make some common function like trait.

bulp
Автор

Wow! I loved this content! thanks! 😍✌🏽

TioJobs
Автор

The idea conceptually is good, but with complicated logic, I would avoid it.

GamePlayByFaks
Автор

I think you forgot that the view file is also different.

gotoslovakia
Автор

This tips not working in inertia request.

sujitsarkar