mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 01:57:13 +00:00
Model hooks (#945)
* Model hooks * composer fix-style * Fix test for ModelHooks Co-authored-by: laravel-ide-helper <[email protected]>
This commit is contained in:
co-authored by
laravel-ide-helper
parent
b8d5fc3663
commit
f0c138c4fd
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\ModelHooks\Hooks;
|
||||
|
||||
use Barryvdh\LaravelIdeHelper\Console\ModelsCommand;
|
||||
use Barryvdh\LaravelIdeHelper\Contracts\ModelHookInterface;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class CustomProperty implements ModelHookInterface
|
||||
{
|
||||
public function run(ModelsCommand $command, Model $model): void
|
||||
{
|
||||
$command->setProperty('custom', 'string', true, false);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user