/** * @param $request * @return mixed * @throws CheckoutException */ public static function generate($request) { $data = $request; $data['transaction'] = uniqid(); if (config('checkout.use_database') === true) { /** * @todo Add database support */ throw new CheckoutException('Database is not supported yet.'); } else { \Storage::prepend(config('checkout.table_prefix') . 'Transactions', $data['transaction'] . '|.' . json_encode($data)); } return $data; }
/** * Execute the command. * * @return void */ public function handle() { parent::handle(); if (!$this->commandData->skipMigration) { $migrationGenerator = new MigrationGenerator($this->commandData); $migrationGenerator->generate(); } $modelGenerator = new ModelGenerator($this->commandData); $modelGenerator->generate(); \Storage::prepend('laravel.log', 'Model Generated'); $AdminModelGenerator = new AdminModelGenerator($this->commandData); $AdminModelGenerator->generate(); $requestGenerator = new RequestGenerator($this->commandData); $requestGenerator->generate(); $adminRequestGenerator = new AdminRequestGenerator($this->commandData); $adminRequestGenerator->generate(); $repositoryGenerator = new RepositoryGenerator($this->commandData); $repositoryGenerator->generate(); $adminRepositoryGenerator = new AdminRepositoryGenerator($this->commandData); $adminRepositoryGenerator->generate(); $adminViewsGenerator = new AdminViewGenerator($this->commandData); $adminViewsGenerator->generate(); $liveViewsGenerator = new LiveViewGenerator($this->commandData); $liveViewsGenerator->generate(); $repoAdminControllerGenerator = new AdminControllerGenerator($this->commandData); $repoAdminControllerGenerator->generate(); $repoControllerGenerator = new ViewControllerGenerator($this->commandData); $repoControllerGenerator->generate(); $repoControllerGenerator = new APIControllerGenerator($this->commandData); $repoControllerGenerator->generate(); $routeGenerator = new RoutesGenerator($this->commandData); $routeGenerator->generate(); if ($this->confirm("\nDo you want to migrate database? [y|N]", false)) { $this->call('migrate'); } }