You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey! This won't be groundbreaking for experienced Laravel developers but I've just realized probably the easiest (and safest) way to override some of Twill's internals through dependency injection. Here's an example with Twill's UserController.
First, add a class into your project extending the base UserController :
// file: app/Http/Controllers/Admin/AppUserController.phpuseA17\Twill\Http\Controllers\Admin\UserController;
class AppUserController extends UserController
{
// customize anything here
}
Then, register the binding in your AppServiceProvider :
And that's it! This is not a silver bullet... you'll probably hit the limits of this approach very quickly. But, as far as this quick experiment went, I could override the user model, controller and request.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hey! This won't be groundbreaking for experienced Laravel developers but I've just realized probably the easiest (and safest) way to override some of Twill's internals through dependency injection. Here's an example with Twill's
UserController
.First, add a class into your project extending the base
UserController
:Then, register the binding in your
AppServiceProvider
:And that's it! This is not a silver bullet... you'll probably hit the limits of this approach very quickly. But, as far as this quick experiment went, I could override the user model, controller and request.
Have fun :)
Beta Was this translation helpful? Give feedback.
All reactions