@@ -45,7 +45,7 @@ |
||
45 | 45 | 'f.*.query_2' => 'required_if:f.*.operator,between,not_between' |
46 | 46 | ]); |
47 | 47 | |
48 | - if($v->fails()) { |
|
48 | + if ($v->fails()) { |
|
49 | 49 | return dd($v->messages()->all()); |
50 | 50 | throw new ValidationException; |
51 | 51 | } |
@@ -18,8 +18,8 @@ discard block |
||
18 | 18 | // dd($meta); |
19 | 19 | $metaModel = new $this->meta_model(); |
20 | 20 | |
21 | - if($this->meta_global == true) { |
|
22 | - $metaModel->model_type = __class__; |
|
21 | + if ($this->meta_global == true) { |
|
22 | + $metaModel->model_type = __class__; |
|
23 | 23 | } |
24 | 24 | $metaModel->{$this->meta_key_name} = $meta[$this->meta_key_name]; |
25 | 25 | $metaModel->{$this->meta_value_name} = $meta[$this->meta_value_name]; |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | |
59 | 59 | if (is_null($value)) { |
60 | 60 | try { |
61 | - if(isset($this->getMeta()->$key)) { |
|
61 | + if (isset($this->getMeta()->$key)) { |
|
62 | 62 | $value = $this->getMeta()->$key->{$this->meta_value_name}; |
63 | 63 | } else { |
64 | 64 | $value = NULL; |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | } |
93 | 93 | } catch (Exception $e) { } |
94 | 94 | |
95 | - if(\Config::get('database.default') === 'sqlite') { |
|
95 | + if (\Config::get('database.default') === 'sqlite') { |
|
96 | 96 | $columns = \DB::select('PRAGMA table_info('.$this->table.')'); |
97 | 97 | |
98 | 98 | foreach ($columns as $column) { |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | $data->{$this->meta_foreign_key} = $this->$primaryKey; |
176 | 176 | } |
177 | 177 | |
178 | - if(!is_null($data->{$this->meta_value_name})) { |
|
178 | + if ( ! is_null($data->{$this->meta_value_name})) { |
|
179 | 179 | $data->save(); |
180 | 180 | } |
181 | 181 | } |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | protected function deleteMeta() |
187 | 187 | { |
188 | 188 | foreach ((array)$this->getMeta() as $data) { |
189 | - if(is_null($data->{$this->meta_value_name})) { |
|
189 | + if (is_null($data->{$this->meta_value_name})) { |
|
190 | 190 | $dataID = $this->meta_primary_key; |
191 | 191 | $data->destroy($data->$dataID); |
192 | 192 | } |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | |------------------------------------------------------------ |
19 | 19 | */ |
20 | 20 | private function imageResize($image, $width, $height = null, $mode = 'expand', $quality = 85) { |
21 | - if($height == null && $mode == 'expand') { |
|
21 | + if ($height == null && $mode == 'expand') { |
|
22 | 22 | $height = $width; |
23 | 23 | } |
24 | 24 | |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | /* |
34 | 34 | * canvas |
35 | 35 | */ |
36 | - $dimension = $width; |
|
36 | + $dimension = $width; |
|
37 | 37 | $desire_width = $width; |
38 | 38 | $desire_height = $height; |
39 | 39 | |
@@ -41,25 +41,25 @@ discard block |
||
41 | 41 | $horizontal = ($img_width > $img_height); |
42 | 42 | $square = ($img_width = $img_height); |
43 | 43 | |
44 | - if($mode == 'expand') { |
|
44 | + if ($mode == 'expand') { |
|
45 | 45 | if ($vertical) { |
46 | 46 | $top = $bottom = $margin; |
47 | 47 | $newHeight = ($dimension) - ($bottom + $top); |
48 | - $img->resize(null, $newHeight, function ($constraint) { |
|
48 | + $img->resize(null, $newHeight, function($constraint) { |
|
49 | 49 | $constraint->aspectRatio(); |
50 | 50 | }); |
51 | 51 | |
52 | 52 | } else if ($horizontal) { |
53 | 53 | $right = $left = $margin; |
54 | 54 | $newWidth = ($dimension) - ($right + $left); |
55 | - $img->resize($newWidth, null, function ($constraint) { |
|
55 | + $img->resize($newWidth, null, function($constraint) { |
|
56 | 56 | $constraint->aspectRatio(); |
57 | 57 | }); |
58 | 58 | |
59 | 59 | } else if ($square) { |
60 | 60 | $right = $left = $margin; |
61 | 61 | $newWidth = ($dimension) - ($left + $right); |
62 | - $img->resize($newWidth, null, function ($constraint) { |
|
62 | + $img->resize($newWidth, null, function($constraint) { |
|
63 | 63 | $constraint->aspectRatio(); |
64 | 64 | }); |
65 | 65 | |
@@ -68,25 +68,25 @@ discard block |
||
68 | 68 | $img->resizeCanvas($dimension, $dimension, 'center', false, '#ffffff'); |
69 | 69 | $img->encode('jpg', $quality); |
70 | 70 | |
71 | - } else if($mode == 'constrain') { |
|
71 | + } else if ($mode == 'constrain') { |
|
72 | 72 | if ($vertical) { |
73 | 73 | $top = $bottom = $margin; |
74 | 74 | $newHeight = ($desire_height) - ($bottom + $top); |
75 | - $img->resize(null, $newHeight, function ($constraint) { |
|
75 | + $img->resize(null, $newHeight, function($constraint) { |
|
76 | 76 | $constraint->aspectRatio(); |
77 | 77 | }); |
78 | 78 | |
79 | 79 | } else if ($horizontal) { |
80 | 80 | $right = $left = $margin; |
81 | 81 | $newWidth = ($desire_width) - ($right + $left); |
82 | - $img->resize($newWidth, null, function ($constraint) { |
|
82 | + $img->resize($newWidth, null, function($constraint) { |
|
83 | 83 | $constraint->aspectRatio(); |
84 | 84 | }); |
85 | 85 | |
86 | 86 | } else if ($square) { |
87 | 87 | $right = $left = $margin; |
88 | 88 | $newWidth = ($desire_width) - ($left + $right); |
89 | - $img->resize($newWidth, null, function ($constraint) { |
|
89 | + $img->resize($newWidth, null, function($constraint) { |
|
90 | 90 | $constraint->aspectRatio(); |
91 | 91 | }); |
92 | 92 |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | $this->makeFilter($query, $filter_prep); |
23 | 23 | } |
24 | 24 | |
25 | - if(isset($data['f'])) { |
|
25 | + if (isset($data['f'])) { |
|
26 | 26 | foreach ($data['f'] as $filter) { |
27 | 27 | $filter['match'] = $data['filter_match'] ?? 'and'; |
28 | 28 | $this->makeFilter($query, $filter); |
@@ -34,17 +34,17 @@ discard block |
||
34 | 34 | } |
35 | 35 | |
36 | 36 | public function makeFilter($query, $filter) { |
37 | - if(strpos($filter['column'], '.') !== false) { |
|
37 | + if (strpos($filter['column'], '.') !== false) { |
|
38 | 38 | // nested column |
39 | 39 | list($relation, $filter['column']) = explode('.', $filter['column']); |
40 | 40 | $filter['match'] = 'and'; |
41 | 41 | // $filter['match'] = 'or'; |
42 | 42 | |
43 | - if($filter['column'] == 'count') { |
|
43 | + if ($filter['column'] == 'count') { |
|
44 | 44 | $this->{camel_case($filter['operator'])}($filter, $query, $relation); |
45 | 45 | |
46 | 46 | } else { |
47 | - if($this->relation_counter == 0) { |
|
47 | + if ($this->relation_counter == 0) { |
|
48 | 48 | $query->whereHas($relation, function($q) use ($filter) { |
49 | 49 | $this->{camel_case($filter['operator'])}($filter, $q); |
50 | 50 | }); |
@@ -21,7 +21,7 @@ |
||
21 | 21 | return [ |
22 | 22 | 'slug' => [ |
23 | 23 | 'source' => 'name', |
24 | - 'method' => function ($string, $separator) { |
|
24 | + 'method' => function($string, $separator) { |
|
25 | 25 | return $this->slugify_th($string, $separator); |
26 | 26 | } |
27 | 27 | ] |
@@ -6,5 +6,5 @@ |
||
6 | 6 | |
7 | 7 | class TermRelationship extends Model |
8 | 8 | { |
9 | - protected $fillable = ['model_type', 'model_id', 'term_taxonomy_id', 'term_order']; |
|
9 | + protected $fillable = ['model_type', 'model_id', 'term_taxonomy_id', 'term_order']; |
|
10 | 10 | } |
@@ -9,10 +9,10 @@ |
||
9 | 9 | protected $fillable = ['term_id', 'taxonomy', 'description', 'parent', 'count']; |
10 | 10 | |
11 | 11 | public function term() { |
12 | - return $this->hasOne('App\Models\Term', 'id', 'term_id'); |
|
12 | + return $this->hasOne('App\Models\Term', 'id', 'term_id'); |
|
13 | 13 | } |
14 | 14 | |
15 | 15 | public function childs() { |
16 | - return $this->hasMany('App\Models\TermTaxonomy', 'parent', 'term_id'); |
|
16 | + return $this->hasMany('App\Models\TermTaxonomy', 'parent', 'term_id'); |
|
17 | 17 | } |
18 | 18 | } |
@@ -15,7 +15,7 @@ |
||
15 | 15 | |
16 | 16 | protected $casts = [ |
17 | 17 | 'custom_properties' => 'array', // Will convarted to (Array) |
18 | - ]; |
|
18 | + ]; |
|
19 | 19 | public function toResponse($request) |
20 | 20 | { |
21 | 21 | $downloadHeaders = [ |
@@ -22,11 +22,11 @@ |
||
22 | 22 | 'Cache-Control' => 'must-revalidate, post-check=0, pre-check=0', |
23 | 23 | 'Content-Type' => $this->mime_type, |
24 | 24 | 'Content-Length' => $this->size, |
25 | - 'Content-Disposition' => 'attachment; filename="' . $this->file_name . '"', |
|
25 | + 'Content-Disposition' => 'attachment; filename="'.$this->file_name.'"', |
|
26 | 26 | 'Pragma' => 'public', |
27 | 27 | ]; |
28 | 28 | |
29 | - return response()->stream(function () { |
|
29 | + return response()->stream(function() { |
|
30 | 30 | $stream = $this->stream(); |
31 | 31 | |
32 | 32 | fpassthru($stream); |
@@ -23,27 +23,27 @@ discard block |
||
23 | 23 | { |
24 | 24 | parent::boot(); |
25 | 25 | |
26 | - self::creating(function($model){ |
|
26 | + self::creating(function($model) { |
|
27 | 27 | // ... code here |
28 | 28 | }); |
29 | 29 | |
30 | - self::created(function($model){ |
|
30 | + self::created(function($model) { |
|
31 | 31 | // ... code here |
32 | 32 | }); |
33 | 33 | |
34 | - self::updating(function($model){ |
|
34 | + self::updating(function($model) { |
|
35 | 35 | // ... code here |
36 | 36 | }); |
37 | 37 | |
38 | - self::updated(function($model){ |
|
38 | + self::updated(function($model) { |
|
39 | 39 | // ... code here |
40 | 40 | }); |
41 | 41 | |
42 | - self::deleting(function($model){ |
|
42 | + self::deleting(function($model) { |
|
43 | 43 | // ... code here |
44 | 44 | }); |
45 | 45 | |
46 | - self::deleted(function($model){ |
|
46 | + self::deleted(function($model) { |
|
47 | 47 | // ... code here |
48 | 48 | }); |
49 | 49 | } |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | return [ |
54 | 54 | 'post_name' => [ |
55 | 55 | 'source' => 'post_title', |
56 | - 'method' => function ($string, $separator) { |
|
56 | + 'method' => function($string, $separator) { |
|
57 | 57 | return $this->slugify_th($string, $separator); |
58 | 58 | } |
59 | 59 | ] |