Comments (2)
Hey,
I really really really don't recommend to use the model toArray()
/toJson()
functionality to return it as a response.
Instead I highly recommend eloquent API resources which allow you to define more explicitly what you return and there you can use $this->type->label
for example.
from laravel-enum.
This issue is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 7 days
from laravel-enum.
Related Issues (20)
- BadMethodCallException: There's no value Some College defined for enum App\Domain\Admission\Enums\HighestEducationEnum, consider adding it in the docblock definition. in ..vendor\spatie\enum\src\Enum.php:157 HOT 1
- Support livewire 3 HOT 5
- Validation throwing errors Livewire v3 HOT 2
- How to set default attribute value for a model like status = draft? HOT 2
- Translator Class not found inside labels method HOT 4
- getting error Laravel folder not found HOT 4
- Unable to groupBy a Collection Using an Enum as a Criteria when Casting HOT 2
- Creating New Model - No Value Defined for Enum HOT 4
- I cant do new model() HOT 2
- use Laravel Enum in combination with database migration (and: how to list possible values) HOT 5
- mark enum values as obsolete/disabled? HOT 2
- Form request validated data is not casted to enum HOT 3
- Custom validation message for EnumValue HOT 2
- Validation message not resolved when using 'enum:' rule instead of EnumRule HOT 1
- Not nullable enums break Laravel Nova create resource HOT 3
- EnumRule issue with different Enums, same value HOT 1
- Minor documentation issue HOT 1
- v1 => v2 and v2 => v3 upgrade guides HOT 2
- How to use FakerEnumProvider? HOT 3
- Compatibility issue with Laravel 10 HOT 2
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.