Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace App\Nova\Actions;
- use Illuminate\Bus\Queueable;
- use Laravel\Nova\Actions\Action;
- use Illuminate\Support\Collection;
- use Laravel\Nova\Fields\ActionFields;
- use Illuminate\Queue\SerializesModels;
- use Illuminate\Queue\InteractsWithQueue;
- use Illuminate\Contracts\Queue\ShouldQueue;
- class ImpersonateUser extends Action
- {
- use InteractsWithQueue, Queueable, SerializesModels;
- /**
- * Perform the action on the given models.
- *
- * @param \Laravel\Nova\Fields\ActionFields $fields
- * @param \Illuminate\Support\Collection $models
- * @return mixed
- */
- public function handle(ActionFields $fields, Collection $models)
- {
- return Action::redirect(
- route('impersonate', $models[0])
- );
- }
- /**
- * Get the fields available on the action.
- *
- * @return array
- */
- public function fields()
- {
- return [];
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement