@@ -62,7 +62,7 @@ |
||
| 62 | 62 | $this->info('No permission is needed for Super Admin'); |
| 63 | 63 | } else { |
| 64 | 64 | MakePermission::makePermission($name, $role_id, $for_all, $only_flags); |
| 65 | - $this->info('Permission' . $only_flags ? 'view and' : 'flags made for model ' . $name); |
|
| 65 | + $this->info('Permission'.$only_flags ? 'view and' : 'flags made for model '.$name); |
|
| 66 | 66 | } |
| 67 | 67 | } |
| 68 | 68 | } |
@@ -44,20 +44,20 @@ |
||
| 44 | 44 | CRUDGeneratorService::makeCRUD($name, $this); |
| 45 | 45 | |
| 46 | 46 | if ($this->option('acl')) { |
| 47 | - Artisan::call('make:permission ' . $name . ' --all'); |
|
| 47 | + Artisan::call('make:permission '.$name.' --all'); |
|
| 48 | 48 | $this->info('ACL created ... ✅'); |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | if ($this->option('api')) { |
| 52 | - Artisan::call('make:api ' . $name); |
|
| 52 | + Artisan::call('make:api '.$name); |
|
| 53 | 53 | $this->info('API resource files created ... ✅'); |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | if ($this->option('rest')) { |
| 57 | - Artisan::call('make:api ' . $name . ' --rest'); |
|
| 57 | + Artisan::call('make:api '.$name.' --rest'); |
|
| 58 | 58 | $this->info('RestAPI files created ... ✅'); |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | - $this->info('CRUD made for model ' . $name . ' ... ✅'); |
|
| 61 | + $this->info('CRUD made for model '.$name.' ... ✅'); |
|
| 62 | 62 | } |
| 63 | 63 | } |
@@ -44,13 +44,13 @@ discard block |
||
| 44 | 44 | $version = $this->option('v'); |
| 45 | 45 | if ($this->option('rest')) { |
| 46 | 46 | MakeAPIResource::makeRestAPI($name, $path, $version); |
| 47 | - $this->info('Restful API Resource created for model ' . $name); |
|
| 47 | + $this->info('Restful API Resource created for model '.$name); |
|
| 48 | 48 | } elseif ($this->option('client')) { |
| 49 | 49 | MakeAPIResource::makeClientAPI($name, $path, $version); |
| 50 | - $this->info('Client API created for model ' . $name); |
|
| 50 | + $this->info('Client API created for model '.$name); |
|
| 51 | 51 | } else { |
| 52 | 52 | MakeAPIResource::makeAPI($name, $path, $version); |
| 53 | - $this->info('API Resource created for model ' . $name); |
|
| 53 | + $this->info('API Resource created for model '.$name); |
|
| 54 | 54 | } |
| 55 | 55 | } |
| 56 | 56 | |
@@ -65,6 +65,6 @@ discard block |
||
| 65 | 65 | { |
| 66 | 66 | $explode_path = preg_split('#/#', $given_name); |
| 67 | 67 | |
| 68 | - return count($explode_path) > 1 ? str_replace('/', '\\', $given_name) : ('App\\Models\\Admin\\' . $given_name); |
|
| 68 | + return count($explode_path) > 1 ? str_replace('/', '\\', $given_name) : ('App\\Models\\Admin\\'.$given_name); |
|
| 69 | 69 | } |
| 70 | 70 | } |
@@ -51,13 +51,13 @@ discard block |
||
| 51 | 51 | $version = $this->option('v'); |
| 52 | 52 | if ($this->option('rest')) { |
| 53 | 53 | MakeAPIResource::makeRestAPI($name, $path, $version); |
| 54 | - $this->info('Restful API Resource created for model ' . $name . ' ... ✅'); |
|
| 54 | + $this->info('Restful API Resource created for model '.$name.' ... ✅'); |
|
| 55 | 55 | } elseif ($this->option('client')) { |
| 56 | 56 | MakeAPIResource::makeClientAPI($name, $path, $version); |
| 57 | - $this->info('Client API created for model ' . $name . ' ... ✅'); |
|
| 57 | + $this->info('Client API created for model '.$name.' ... ✅'); |
|
| 58 | 58 | } else { |
| 59 | 59 | MakeAPIResource::makeAPI($name, $path, $version); |
| 60 | - $this->info('API Resource created for model ' . $name . ' ... ✅'); |
|
| 60 | + $this->info('API Resource created for model '.$name.' ... ✅'); |
|
| 61 | 61 | } |
| 62 | 62 | } |
| 63 | 63 | } |
@@ -75,6 +75,6 @@ discard block |
||
| 75 | 75 | { |
| 76 | 76 | $explode_path = preg_split('#/#', $given_name); |
| 77 | 77 | |
| 78 | - return count($explode_path) > 1 ? str_replace('/', '\\', $given_name) : ('App\\Models\\Admin\\' . $given_name); |
|
| 78 | + return count($explode_path) > 1 ? str_replace('/', '\\', $given_name) : ('App\\Models\\Admin\\'.$given_name); |
|
| 79 | 79 | } |
| 80 | 80 | } |
@@ -42,11 +42,11 @@ |
||
| 42 | 42 | protected function makeDynamicClass($name) |
| 43 | 43 | { |
| 44 | 44 | if ($name == 'User') { |
| 45 | - $className = 'App\\Models\\' . Str::ucfirst($name); |
|
| 45 | + $className = 'App\\Models\\'.Str::ucfirst($name); |
|
| 46 | 46 | } elseif ($name == 'Permission' || $name == 'Preference' || $name == 'Profile' || $name == 'Role' || $name == 'Setting') { |
| 47 | - $className = 'Pratiksh\\Adminetic\\Models\\Admin\\' . Str::ucfirst($name); |
|
| 47 | + $className = 'Pratiksh\\Adminetic\\Models\\Admin\\'.Str::ucfirst($name); |
|
| 48 | 48 | } else { |
| 49 | - $className = 'App\\Models\\Admin\\' . Str::ucfirst($name); |
|
| 49 | + $className = 'App\\Models\\Admin\\'.Str::ucfirst($name); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | return new $className; |
@@ -69,11 +69,11 @@ discard block |
||
| 69 | 69 | protected static function makeViews($name, $console) |
| 70 | 70 | { |
| 71 | 71 | $lowername = strtolower($name); |
| 72 | - if (!file_exists($path = resource_path('views/admin/' . $lowername))) { |
|
| 72 | + if (!file_exists($path = resource_path('views/admin/'.$lowername))) { |
|
| 73 | 73 | mkdir($path, 0777, true); |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | - if (!file_exists($path = resource_path('views/admin/layouts/modules/' . $lowername))) { |
|
| 76 | + if (!file_exists($path = resource_path('views/admin/layouts/modules/'.$lowername))) { |
|
| 77 | 77 | mkdir($path, 0777, true); |
| 78 | 78 | } |
| 79 | 79 | |
@@ -172,16 +172,16 @@ discard block |
||
| 172 | 172 | // Make Other neccesary CRUD files |
| 173 | 173 | protected static function makeOthers($name, $console) |
| 174 | 174 | { |
| 175 | - Artisan::call('make:migration create_' . strtolower(Str::plural($name)) . '_table --create=' . strtolower(Str::plural($name))); |
|
| 176 | - $console->info('Migration file created named create_' . strtolower(Str::plural($name)) . '_table ... ✅'); |
|
| 175 | + Artisan::call('make:migration create_'.strtolower(Str::plural($name)).'_table --create='.strtolower(Str::plural($name))); |
|
| 176 | + $console->info('Migration file created named create_'.strtolower(Str::plural($name)).'_table ... ✅'); |
|
| 177 | 177 | |
| 178 | - Artisan::call('make:seeder ' . $name . 'Seeder'); |
|
| 178 | + Artisan::call('make:seeder '.$name.'Seeder'); |
|
| 179 | 179 | $console->info('Seeder file created ... ✅'); |
| 180 | 180 | |
| 181 | - Artisan::call('make:repo ' . $name); |
|
| 181 | + Artisan::call('make:repo '.$name); |
|
| 182 | 182 | $console->info('Repository and Interface created ... ✅'); |
| 183 | 183 | |
| 184 | - Artisan::call('make:request ' . $name . 'Request'); |
|
| 184 | + Artisan::call('make:request '.$name.'Request'); |
|
| 185 | 185 | $console->info('Request file created ... ✅'); |
| 186 | 186 | } |
| 187 | 187 | // Make Other Necessary CRUD Files |
@@ -190,34 +190,34 @@ discard block |
||
| 190 | 190 | // Adding Route |
| 191 | 191 | $lowercased_name = strtolower($name); |
| 192 | 192 | $route = "Route::resource('admin/{$lowercased_name}',\App\Http\Controllers\Admin\\{$name}Controller::class);"; |
| 193 | - file_put_contents('routes/web.php', "\n", FILE_APPEND | LOCK_EX); |
|
| 194 | - file_put_contents('routes/web.php', $route, FILE_APPEND | LOCK_EX); |
|
| 193 | + file_put_contents('routes/web.php', "\n", FILE_APPEND | LOCK_EX); |
|
| 194 | + file_put_contents('routes/web.php', $route, FILE_APPEND | LOCK_EX); |
|
| 195 | 195 | |
| 196 | 196 | $console->info('Route added to web.php ... ✅'); |
| 197 | 197 | |
| 198 | 198 | // Adding Route Interface Binding |
| 199 | - $repository_interface_binding = '$this->app->bind(\App\Contracts\\' . $name . 'RepositoryInterface::class, \App\Repositories\\' . $name . 'Repository::class);'; |
|
| 199 | + $repository_interface_binding = '$this->app->bind(\App\Contracts\\'.$name.'RepositoryInterface::class, \App\Repositories\\'.$name.'Repository::class);'; |
|
| 200 | 200 | $provider_path = app_path('Providers/AdminServiceProvider.php'); |
| 201 | 201 | putContentToClassFunction($provider_path, 'protected function repos', $repository_interface_binding); |
| 202 | 202 | |
| 203 | 203 | // Adding Module To Menu |
| 204 | - $menu_content = "],[\n" . |
|
| 205 | - "'type' => 'menu',\n" . |
|
| 206 | - "'name' => '$name',\n" . |
|
| 207 | - "'icon' => 'fa fa-wrench',\n" . |
|
| 208 | - "'is_active' => request()->routeIs('$lowercased_name*') ? 'active' : '',\n" . |
|
| 209 | - "'conditions' => [\n" . |
|
| 210 | - "[\n" . |
|
| 211 | - "'type' => 'or',\n" . |
|
| 212 | - "'condition' => auth()->user()->can('view-any', \App\Models\Admin\\" . $name . "::class),\n" . |
|
| 213 | - "],\n" . |
|
| 214 | - "[\n" . |
|
| 215 | - "'type' => 'or',\n" . |
|
| 216 | - "'condition' => auth()->user()->can('create', \App\Models\Admin\\" . $name . "::class),\n" . |
|
| 217 | - "],\n" . |
|
| 204 | + $menu_content = "],[\n". |
|
| 205 | + "'type' => 'menu',\n". |
|
| 206 | + "'name' => '$name',\n". |
|
| 207 | + "'icon' => 'fa fa-wrench',\n". |
|
| 208 | + "'is_active' => request()->routeIs('$lowercased_name*') ? 'active' : '',\n". |
|
| 209 | + "'conditions' => [\n". |
|
| 210 | + "[\n". |
|
| 211 | + "'type' => 'or',\n". |
|
| 212 | + "'condition' => auth()->user()->can('view-any', \App\Models\Admin\\".$name."::class),\n". |
|
| 213 | + "],\n". |
|
| 214 | + "[\n". |
|
| 215 | + "'type' => 'or',\n". |
|
| 216 | + "'condition' => auth()->user()->can('create', \App\Models\Admin\\".$name."::class),\n". |
|
| 217 | + "],\n". |
|
| 218 | 218 | "],\n"; |
| 219 | - $menu_content = $menu_content . '"children" => $this->indexCreateChildren("' . $lowercased_name . '", \App\Models\Admin\\' . $name . '::class),'; |
|
| 220 | - $menu_content = "\n" . $menu_content . "\n"; |
|
| 219 | + $menu_content = $menu_content.'"children" => $this->indexCreateChildren("'.$lowercased_name.'", \App\Models\Admin\\'.$name.'::class),'; |
|
| 220 | + $menu_content = "\n".$menu_content."\n"; |
|
| 221 | 221 | $menu_path = app_path("Services/MyMenu.php"); |
| 222 | 222 | putContentToClassFunction($menu_path, 'return [', $menu_content, ']'); |
| 223 | 223 | |
@@ -227,9 +227,9 @@ discard block |
||
| 227 | 227 | protected static function fileMadeSuccess($console, $file, $type) |
| 228 | 228 | { |
| 229 | 229 | if (file_exists($file)) { |
| 230 | - $console->info($type . ' created successfully ... ✅'); |
|
| 230 | + $console->info($type.' created successfully ... ✅'); |
|
| 231 | 231 | } else { |
| 232 | - $console->error('Failed to create ' . $type . ' ...'); |
|
| 232 | + $console->error('Failed to create '.$type.' ...'); |
|
| 233 | 233 | } |
| 234 | 234 | } |
| 235 | 235 | } |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | { |
| 56 | 56 | if (!is_null($this->delete_limit)) { |
| 57 | 57 | Activity::whereDate('created_at', '<', Carbon::now()->subDays($this->delete_limit))->delete(); |
| 58 | - $this->emit('activity_success', 'All activities Deleted except last ' . $this->delete_limit . 'days activities'); |
|
| 58 | + $this->emit('activity_success', 'All activities Deleted except last '.$this->delete_limit.'days activities'); |
|
| 59 | 59 | } |
| 60 | 60 | } |
| 61 | 61 | |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | { |
| 9 | 9 | public function index() |
| 10 | 10 | { |
| 11 | - $file_path = public_path() . '/adminetic/assets/js/icon-picker/iconpicker-1.5.0.json'; |
|
| 11 | + $file_path = public_path().'/adminetic/assets/js/icon-picker/iconpicker-1.5.0.json'; |
|
| 12 | 12 | $fonts = file_exists($file_path) ? json_decode(file_get_contents($file_path), true) : null; |
| 13 | 13 | |
| 14 | 14 | return view('adminetic::admin.fontawesome.index', compact('fonts')); |