Support the ongoing development of Laravel.io →
Requests Validation
Last updated 6 months ago.
0

FYI, I've tried to do the same thing with a class, and also this didn't work.

To give you some basic code, with the trait:

trait MyTrait extends FormRequest { ... }

class ClassOne { use MyTrait; }

class ClassTwo { use MyTrait; }

With classes and no traits:

class MyMainClass extends FormRequest { ... }

class ClassOne extends MyMainClass { ... }

class ClassTwo extends MyMainClass { ... }

Thanks again!

0

Sign in to participate in this thread!

LoadForge

Your banner here too?

lucaprete lucaprete Joined 11 Feb 2017

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 Laravel.io - All rights reserved.