Support the ongoing development of Laravel.io →
Requests Validation
Last updated 2 years 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!

Eventy

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.

© 2024 Laravel.io - All rights reserved.