/** * Execute the console command. * * @return mixed */ public function handle() { $name = $this->argument('name'); $format = $this->argument('format'); $url = $this->argument('url'); $repository = Repository::firstOrCreate(['name' => $name, 'format' => $format, 'url' => $url]); $this->dispatch(new ApacheCrawlerJob($repository)); // $job = new ApacheCrawlerJob($repository); // $job->handle(new \Goutte\Client); // dd($job); // $loader = Factory::make($format, $locale); // $output = $loader->read($path); // dd($output); }
/** * Bootstrap any application services. * * @return void */ public function boot() { $user = Auth::user() ?: User::whereEmail('system@twine')->first(); Repository::creating(function ($model) use($user) { $model->created_by = $user->id; }); Project::creating(function ($model) use($user) { $model->created_by = $user->id; }); String::creating(function ($model) use($user) { $model->created_by = $user->id; }); Source::creating(function ($model) use($user) { $model->created_by = $user->id; }); }