Comments (8)
Can you provide some context?
That error is usually caused because the enum class hasn't been imported or is using the wrong path. Make sure you're either importing it using the use statement or are using the fully qualified path name.
from laravel-enum.
- In the Controller
BenSampo\Enum\EnumServiceProvider
addeduse BenSampo\Enum\Rules\EnumValue
added- Validation code:
public function store(Request $request)
{
$this->validate($request, [
'type' => [new EnumValue(RpType::class)],
]);
}
from laravel-enum.
Have you included a use statement for RpType?
By default it would be in App\Enums\RpType
from laravel-enum.
Looking at the error message again, perhaps the resolve
method doesn't exist in Lumen? It was introduced to Laravel in 5.3.
You could try changing line line 17 of BenSampo\Enum\Rules\EnumValue locally to use 'app' instead of 'resolve' to see if that helps.
https://github.com/BenSampo/laravel-enum/blob/master/src/Rules/EnumValue.php#L17
Let me know if it does.
from laravel-enum.
Works great if change resolve
to app
. 👍 But I cannot commit the changes in the vendor directory.
from laravel-enum.
My Lumen version is 5.6. Works great if changing resolve
to app
.
from laravel-enum.
I've pushed and tagged a new release which should fix this. Update to 1.11.1 and you should be good to go!
from laravel-enum.
I will try. Thanks!
from laravel-enum.
Related Issues (20)
- Optional enum validaiton. HOT 1
- classDeclarationOffset unavailable when content removed with existing docblock HOT 6
- Support Laravel 10 HOT 1
- asSelectArray no return description localization HOT 2
- `enum:annotate` command breaks existing docblock descriptions
- add extra attributes HOT 2
- Adding extra Attributes HOT 4
- localization path HOT 1
- Calling translator in boot breaks translation loading HOT 3
- validateEnumValue does not exist HOT 9
- Add `$hidden` property to Enums HOT 1
- I am stepping down from feature development
- Enum returns incomparable instances HOT 1
- EnumServiceProvider breaks nova translations HOT 3
- Can't install on php8.3.1 HOT 4
- Installation problem HOT 2
- Dump phpunit/phpunit to v11 HOT 1
- Error when converting enums using the rector command HOT 1
- False positive when converting to native enums HOT 2
- Upgrade to laravel 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-enum.