- Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
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()
Metadata
Metadata
Assignees
Labels
No labels