@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | $fullStoragePath = storage_path('app/'.$fullFilePath); |
| 35 | 35 | $lifetime = 31556926; // One year in seconds |
| 36 | 36 | |
| 37 | - if (! Storage::exists($fullFilePath)) { |
|
| 37 | + if (!Storage::exists($fullFilePath)) { |
|
| 38 | 38 | abort(404); |
| 39 | 39 | } |
| 40 | 40 | |
@@ -55,10 +55,10 @@ discard block |
||
| 55 | 55 | $h = Request::get('h') ?: $w; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - $imgRaw = Image::cache(function ($image) use ($fullStoragePath, $w, $h) { |
|
| 58 | + $imgRaw = Image::cache(function($image) use ($fullStoragePath, $w, $h) { |
|
| 59 | 59 | $im = $image->make($fullStoragePath); |
| 60 | 60 | if ($w) { |
| 61 | - if (! $h) { |
|
| 61 | + if (!$h) { |
|
| 62 | 62 | $im->fit($w); |
| 63 | 63 | } else { |
| 64 | 64 | $im->fit($w, $h); |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | public function send() { |
| 44 | - Mail::send("crudbooster::emails.blank", ['content' => $this->content], function ($message) { |
|
| 44 | + Mail::send("crudbooster::emails.blank", ['content' => $this->content], function($message) { |
|
| 45 | 45 | $message->priority(1); |
| 46 | 46 | $message->to($this->to_email); |
| 47 | 47 | $message->from($this->sender_email, $this->sender_name); |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | class CheckboxHelper |
| 12 | 12 | { |
| 13 | 13 | public static function parseValuesToArray($values) { |
| 14 | - $data = explode(";",$values); |
|
| 14 | + $data = explode(";", $values); |
|
| 15 | 15 | return $data; |
| 16 | 16 | } |
| 17 | 17 | |
@@ -1,12 +1,12 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -\Validator::extend('alpha_spaces', function ($attribute, $value) { |
|
| 3 | +\Validator::extend('alpha_spaces', function($attribute, $value) { |
|
| 4 | 4 | // This will only accept alpha and spaces. |
| 5 | 5 | // If you want to accept hyphens use: /^[\pL\s-]+$/u. |
| 6 | 6 | return preg_match('/^[\pL\s]+$/u', $value); |
| 7 | 7 | },'The :attribute should be letters and spaces only'); |
| 8 | 8 | |
| 9 | -\Validator::extend('alpha_num_spaces', function ($attribute, $value) { |
|
| 9 | +\Validator::extend('alpha_num_spaces', function($attribute, $value) { |
|
| 10 | 10 | // This will only accept alphanumeric and spaces. |
| 11 | 11 | return preg_match('/^[a-zA-Z0-9\s]+$/', $value); |
| 12 | 12 | },'The :attribute should be alphanumeric characters and spaces only'); |
| 13 | 13 | \ No newline at end of file |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | public function up() |
| 14 | 14 | { |
| 15 | - Schema::create('cb_role_privileges', function (Blueprint $table) { |
|
| 15 | + Schema::create('cb_role_privileges', function(Blueprint $table) { |
|
| 16 | 16 | $table->increments("id"); |
| 17 | 17 | $table->integer("cb_roles_id"); |
| 18 | 18 | $table->integer("cb_menus_id"); |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | public function up() |
| 14 | 14 | { |
| 15 | - Schema::create('cb_roles', function (Blueprint $table) { |
|
| 15 | + Schema::create('cb_roles', function(Blueprint $table) { |
|
| 16 | 16 | $table->increments("id"); |
| 17 | 17 | $table->string('name'); |
| 18 | 18 | }); |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | public function up() |
| 14 | 14 | { |
| 15 | - Schema::create('cb_modules', function (Blueprint $table) { |
|
| 15 | + Schema::create('cb_modules', function(Blueprint $table) { |
|
| 16 | 16 | $table->increments("id"); |
| 17 | 17 | $table->string('name'); |
| 18 | 18 | $table->string("icon"); |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | @endforeach |
| 11 | 11 | |
| 12 | 12 | <?php |
| 13 | - if(cb()->getCurrentMethod()=="getEdit") { |
|
| 13 | + if (cb()->getCurrentMethod() == "getEdit") { |
|
| 14 | 14 | /** @var $row object */ |
| 15 | 15 | columnSingleton()->valueAssignment($row); |
| 16 | 16 | } |
@@ -27,10 +27,10 @@ discard block |
||
| 27 | 27 | public function getIndex() { |
| 28 | 28 | $data = []; |
| 29 | 29 | $data['result'] = DB::table("users") |
| 30 | - ->join("cb_roles","cb_roles.id","=","cb_roles_id") |
|
| 31 | - ->select("users.*","cb_roles.name as cb_roles_name") |
|
| 30 | + ->join("cb_roles", "cb_roles.id", "=", "cb_roles_id") |
|
| 31 | + ->select("users.*", "cb_roles.name as cb_roles_name") |
|
| 32 | 32 | ->get(); |
| 33 | - return view($this->view.'.index',$data); |
|
| 33 | + return view($this->view.'.index', $data); |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | public function getAdd() { |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | public function postAddSave() { |
| 43 | 43 | try { |
| 44 | - cb()->validation(['name', 'email','password','cb_roles_id']); |
|
| 44 | + cb()->validation(['name', 'email', 'password', 'cb_roles_id']); |
|
| 45 | 45 | |
| 46 | 46 | $user = []; |
| 47 | 47 | $user['name'] = request('name'); |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | $user['cb_roles_id'] = request('cb_roles_id'); |
| 51 | 51 | DB::table('users')->insert($user); |
| 52 | 52 | |
| 53 | - return cb()->redirect(route("DeveloperUsersControllerGetIndex"),"New user has been created!","success"); |
|
| 53 | + return cb()->redirect(route("DeveloperUsersControllerGetIndex"), "New user has been created!", "success"); |
|
| 54 | 54 | |
| 55 | 55 | } catch (CBValidationException $e) { |
| 56 | 56 | return cb()->redirectBack($e->getMessage()); |
@@ -66,16 +66,16 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | public function postEditSave($id) { |
| 68 | 68 | try { |
| 69 | - cb()->validation(['name', 'email','cb_roles_id']); |
|
| 69 | + cb()->validation(['name', 'email', 'cb_roles_id']); |
|
| 70 | 70 | |
| 71 | 71 | $user = []; |
| 72 | 72 | $user['name'] = request('name'); |
| 73 | 73 | $user['email'] = request('email'); |
| 74 | - if(request('password')) $user['password'] = Hash::make(request('password')); |
|
| 74 | + if (request('password')) $user['password'] = Hash::make(request('password')); |
|
| 75 | 75 | $user['cb_roles_id'] = request('cb_roles_id'); |
| 76 | - DB::table('users')->where('id',$id)->update($user); |
|
| 76 | + DB::table('users')->where('id', $id)->update($user); |
|
| 77 | 77 | |
| 78 | - return cb()->redirect(route("DeveloperUsersControllerGetIndex"),"The user has been updated!","success"); |
|
| 78 | + return cb()->redirect(route("DeveloperUsersControllerGetIndex"), "The user has been updated!", "success"); |
|
| 79 | 79 | |
| 80 | 80 | } catch (CBValidationException $e) { |
| 81 | 81 | return cb()->redirectBack($e->getMessage()); |
@@ -83,8 +83,8 @@ discard block |
||
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | public function getDelete($id) { |
| 86 | - DB::table("users")->where("id",$id)->delete(); |
|
| 87 | - return cb()->redirectBack("The user has been deleted!","success"); |
|
| 86 | + DB::table("users")->where("id", $id)->delete(); |
|
| 87 | + return cb()->redirectBack("The user has been deleted!", "success"); |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | } |
| 91 | 91 | \ No newline at end of file |