Skip to content

Commit

Permalink
Update cast.stub
Browse files Browse the repository at this point in the history
  • Loading branch information
MoamenEltouny committed Feb 5, 2024
1 parent f72ef24 commit 97e3461
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions src/Core/Commands/stubs/cast.stub
Expand Up @@ -3,33 +3,26 @@
namespace {{ namespace }};

use Illuminate\Contracts\Database\Eloquent\CastsAttributes;
use Illuminate\Database\Eloquent\Model;

class {{ class }} implements CastsAttributes
{
/**
* Cast the given value.
*
* @param \Illuminate\Database\Eloquent\Model $model
* @param string $key
* @param mixed $value
* @param array $attributes
* @return mixed
* @param array<string, mixed> $attributes
*/
public function get($model, string $key, $value, array $attributes)
public function get(Model $model, string $key, mixed $value, array $attributes): mixed
{
return $value;
}

/**
* Prepare the given value for storage.
*
* @param \Illuminate\Database\Eloquent\Model $model
* @param string $key
* @param mixed $value
* @param array $attributes
* @return mixed
* @param array<string, mixed> $attributes
*/
public function set($model, string $key, $value, array $attributes)
public function set(Model $model, string $key, mixed $value, array $attributes): mixed
{
return $value;
}
Expand Down

0 comments on commit 97e3461

Please sign in to comment.