Skip to content

Commit

Permalink
Pass days to strike method
Browse files Browse the repository at this point in the history
  • Loading branch information
cholladay0816 committed Dec 27, 2023
1 parent 7fb8bb1 commit ca1ce14
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/Nova/Actions/Strike.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Laravel\Nova\Actions\Action;
use Laravel\Nova\Actions\DestructiveAction;
use Laravel\Nova\Fields\ActionFields;
use Laravel\Nova\Fields\Number;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Http\Requests\NovaRequest;

Expand All @@ -27,7 +28,7 @@ class Strike extends DestructiveAction
public function handle(ActionFields $fields, Collection $models)
{
foreach ($models as $model) {
$model->addStrike($fields->get('reason'));
$model->addStrike($fields->get('days'), $fields->get('reason'));
}
}

Expand All @@ -39,6 +40,7 @@ public function handle(ActionFields $fields, Collection $models)
public function fields(NovaRequest $request)
{
return [
Number::make('Days')->default(7),
Text::make('Reason')
];
}
Expand Down

0 comments on commit ca1ce14

Please sign in to comment.