info('Token for user '.$user->name); $token = $user->createToken('Personal Access Token')->accessToken; $this->info($token); })->describe('Generates a personal access token for a user'); Artisan::command('cleaner:clean', function() { $service = new \App\Services\Registries\CleanerService(); $service->clean(); }); Artisan::command('htmlparser:import-rulesets', function() { $registry = Registry::query()->where(['type' => RegistryType::RULESET])->first(); $url = "https://faufcc.ru/technical-regulation-in-constuction/formulary-list/"; $service = new RulesetImportService($registry, $url); $service->import(); }); Artisan::command('htmlparser:import-developments', function() { $registry = Registry::query()->where(['type' => RegistryType::DEVELOPMENTS])->first(); $urls = [ "https://www.faufcc.ru/_deyatelnost/_tehnicheskoe_normirovanie/_razrabotka_svodov_pravil/", "https://www.faufcc.ru/_deyatelnost/_tehnicheskoe_normirovanie/_razrabotka_svodov_pravil/?PAGEN_1=2", "https://www.faufcc.ru/_deyatelnost/_tehnicheskoe_normirovanie/_razrabotka_svodov_pravil/?PAGEN_1=3" ]; foreach ($urls as $url) { $service = new DevelopmentsImportService($registry, $url); $service->import(); } }); Artisan::command('dev:import-ntd', function() { Excel::import(new \App\Imports\NtdRegistryImport(), Storage::path('import/registries/ntd.xlsx')); }); Artisan::command('htmlparser:import-ts', function() { $registry = Registry::query()->where(['type' => RegistryType::TECHNICAL_CERTIFICATES])->first(); $url = 'https://www.faufcc.ru/_deyatelnost/_otsenka-prigodnosti/_reestr-tekhnicheskikh-svidetelstv/?PAGEN_1='; for ($i = 1; $i <= 44; $i++) { echo "Parsing page {$i}\n"; $service = new \App\Services\Registries\TechnicalCertificatesImportService($registry, "{$url}{$i}"); $service->import(); } }); Artisan::command('htmlparser:import-news', function() { $url = 'https://www.faufcc.ru/_press-tsentr/novosti/?PAGEN_1='; for ($i = 1; $i <= 88; $i++) { echo "Parsing page {$i}\n"; $service = new \App\Services\Registries\NewsImportService(Registry::find(1), "{$url}{$i}"); $service->import(); } }); Artisan::command('htmlparser:import-anticor', function() { $url = 'https://www.faufcc.ru/about-us/protivodeystvie-korruptsii/'; $registry = \App\Models\Pages\Page::byUrl('/o-tsentre/protivodeistvie-korruptsii')->registry; $service = new \App\Services\Registries\AnticorImportService($registry, $url); $service->import(); });