-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
93e25b8
commit 479ad35
Showing
4 changed files
with
133 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
namespace AnourValar\EloquentValidation\Console\Commands; | ||
|
||
class ObserverMakeCommand extends \Illuminate\Foundation\Console\ObserverMakeCommand | ||
{ | ||
/** | ||
* The console command name. | ||
* | ||
* @var string | ||
*/ | ||
protected $name = 'make:observer-validation'; | ||
|
||
/** | ||
* The console command description. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = 'Create a new observer class [eloquent-validation]'; | ||
|
||
/** | ||
* {@inheritDoc} | ||
* @see \Illuminate\Foundation\Console\ModelMakeCommand::getStub() | ||
*/ | ||
protected function getStub() | ||
{ | ||
if ($this->option('model')) { | ||
return __DIR__.'/../../resources/observer.stub'; | ||
} | ||
|
||
return parent::getStub(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
<?php | ||
|
||
namespace {{ namespace }}; | ||
|
||
use {{ namespacedModel }}; | ||
|
||
class {{ class }} | ||
{ | ||
/** | ||
* Handle the "saving" event. | ||
* | ||
* @param \{{ namespacedModel }} $model | ||
* @return mixed | ||
*/ | ||
public function saving({{ model }} $model) | ||
{ | ||
|
||
} | ||
|
||
/** | ||
* Handle the "creating" event. | ||
* | ||
* @param \{{ namespacedModel }} $model | ||
* @return mixed | ||
*/ | ||
public function creating({{ model }} $model) | ||
{ | ||
|
||
} | ||
|
||
/** | ||
* Handle the "updating" event. | ||
* | ||
* @param \{{ namespacedModel }} $model | ||
* @return mixed | ||
*/ | ||
public function updating({{ model }} $model) | ||
{ | ||
|
||
} | ||
|
||
/** | ||
* Handle the "created" event. | ||
* | ||
* @param \{{ namespacedModel }} $model | ||
* @return void | ||
*/ | ||
public function created({{ model }} $model) | ||
{ | ||
|
||
} | ||
|
||
/** | ||
* Handle the "updated" event. | ||
* | ||
* @param \{{ namespacedModel }} $model | ||
* @return void | ||
*/ | ||
public function updated({{ model }} $model) | ||
{ | ||
|
||
} | ||
|
||
/** | ||
* Handle the "saved" event. | ||
* | ||
* @param \{{ namespacedModel }} $model | ||
* @return void | ||
*/ | ||
public function saved({{ model }} $model) | ||
{ | ||
|
||
} | ||
|
||
/** | ||
* Handle the "deleting" event. | ||
* | ||
* @param \{{ namespacedModel }} $model | ||
* @return mixed | ||
*/ | ||
public function deleting({{ model }} $model) | ||
{ | ||
|
||
} | ||
|
||
/** | ||
* Handle the "deleted" event. | ||
* | ||
* @param \{{ namespacedModel }} $model | ||
* @return void | ||
*/ | ||
public function deleted({{ model }} $model) | ||
{ | ||
|
||
} | ||
} |