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
i found that if you change src/Casts/ConfigValueCast.php line 12 and line 24 from
line 12: public function get(Model $model, string $key, mixed $value, array $attributes)
to: public function get($model, string $key, mixed $value, array $attributes)
and line 24 from: public function set(Model $model, string $key, mixed $value, array $attributes)
to: public function set($model, string $key, mixed $value, array $attributes)
it works fixing all the problems
this is the error
Symfony\Component\ErrorHandler\Error\FatalError
Declaration of TarfinLabs\LaravelConfig\Casts\ConfigValueCast::get(Illuminate\Database\Eloquent\Model $model, string $key, $value, array $attributes) must be compatible with Illuminate\Contracts\Database\Eloquent\CastsAttributes::get($model, string $key, $value, array $attributes)
at vendor/tarfin-labs/laravel-config/src/Casts/ConfigValueCast.php:12
8▕ use TarfinLabs\LaravelConfig\Enums\ConfigDataType;
9▕
10▕ class ConfigValueCast implements CastsAttributes
11▕ {
➜ 12▕ public function get(Model $model, string $key, $value, array $attributes)
13▕ {
14▕ return match ($attributes['type']) {
15▕ ConfigDataType::BOOLEAN->value => (bool) $value,
16▕ ConfigDataType::INTEGER->value => (int) $value,
vendor frames
5 artisan:0
{main}()
Whoops\Exception\ErrorException
Declaration of TarfinLabs\LaravelConfig\Casts\ConfigValueCast::get(Illuminate\Database\Eloquent\Model $model, string $key, $value, array $attributes) must be compatible with Illuminate\Contracts\Database\Eloquent\CastsAttributes::get($model, string $key, $value, array $attributes)
at vendor/tarfin-labs/laravel-config/src/Casts/ConfigValueCast.php:12
8▕ use TarfinLabs\LaravelConfig\Enums\ConfigDataType;
9▕
10▕ class ConfigValueCast implements CastsAttributes
11▕ {
➜ 12▕ public function get(Model $model, string $key, $value, array $attributes)
13▕ {
14▕ return match ($attributes['type']) {
15▕ ConfigDataType::BOOLEAN->value => (bool) $value,
16▕ ConfigDataType::INTEGER->value => (int) $value,
vendor frames
2 [internal]:0
Whoops\Run::handleShutdown()
The text was updated successfully, but these errors were encountered:
the defined of parameter was came from Laravel 10.x, if you are using lower than 10.x it would be like that. idk, it could work across versions or not.
edit:
if the problem is only from ide, not the Laravel. then, it should be fine.
i found that if you change src/Casts/ConfigValueCast.php line 12 and line 24 from
line 12:
public function get(Model $model, string $key, mixed $value, array $attributes)
to:
public function get($model, string $key, mixed $value, array $attributes)
and line 24 from:
public function set(Model $model, string $key, mixed $value, array $attributes)
to:
public function set($model, string $key, mixed $value, array $attributes)
it works fixing all the problems
this is the error
The text was updated successfully, but these errors were encountered: