%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/camillo/camillo-api-master/app/Nova/Actions/
Upload File :
Create Path :
Current File : /var/www/html/camillo/camillo-api-master/app/Nova/Actions/StartJob.php

<?php

namespace App\Nova\Actions;

use App\Jobs\CallGenerator;
use GuzzleHttp\Client;
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 StartJob extends Action
{
    use InteractsWithQueue, Queueable, SerializesModels;

    public function name() {
        return __('start_job');
    }

    /**
     * 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)
    {
            $job = (new CallGenerator());
            $job->handle(12);
//            $job->handle($models->first()->id);

            //TODO mettere a mano istituto 12

        return Action::message(__('job_started'));
    }

    /**
     * Get the fields available on the action.
     *
     * @return array
     */
    public function fields()
    {
        return [];
    }
}

Zerion Mini Shell 1.0