@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | { |
38 | 38 | //$request['slug'] = str_slug($request->slug, '-'); |
39 | 39 | |
40 | - $this->validate($request, [ //@todo create custom Request class for redirect validation |
|
40 | + $this->validate($request, [//@todo create custom Request class for redirect validation |
|
41 | 41 | 'slug' => 'max:185|required|unique:redirects', |
42 | 42 | 'to' => 'required|max:185', |
43 | 43 | 'type' => 'required|numeric|in:301,302' |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | ['to' => $request['to'], |
49 | 49 | 'type' => $request['type']]); |
50 | 50 | |
51 | - if($redirect->save()){ |
|
51 | + if ($redirect->save()) { |
|
52 | 52 | return redirect()->route('dashboard.redirects'); |
53 | 53 | } |
54 | 54 | } |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | { |
58 | 58 | //$request['slug'] = str_slug($request->slug, '-'); |
59 | 59 | |
60 | - $this->validate($request, [ //@todo create custom Request class for redirect validation |
|
60 | + $this->validate($request, [//@todo create custom Request class for redirect validation |
|
61 | 61 | 'id' => 'required', |
62 | 62 | 'slug' => 'required|max:185', |
63 | 63 | 'to' => 'required|max:185', |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | |
80 | 80 | $redirect = Redirect::where('id', $request['id'])->first(); |
81 | 81 | |
82 | - if($redirect->delete()){ |
|
82 | + if ($redirect->delete()) { |
|
83 | 83 | return redirect()->route('dashboard.redirects'); |
84 | 84 | } |
85 | 85 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | public function save(Request $request) |
31 | 31 | { |
32 | 32 | //validate the request |
33 | - $this->validate(request(), [ //@todo create custom Request class for site validation |
|
33 | + $this->validate(request(), [//@todo create custom Request class for site validation |
|
34 | 34 | 'site_name' => 'max:185|required', |
35 | 35 | 'site_slug' => 'max:70', |
36 | 36 | 'site_domain' => 'required', |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | |
62 | 62 | public function activate(Request $request) |
63 | 63 | { |
64 | - $this->validate(request(), [ //@todo create custom Request class for user password validation |
|
64 | + $this->validate(request(), [//@todo create custom Request class for user password validation |
|
65 | 65 | 'password' => 'required|min:8|regex:/^.*(?=.{3,})(?=.*[a-zA-Z])(?=.*[0-9])(?=.*[\d\X])(?=.*[!$#%]).*$/', |
66 | 66 | 'password_again' => 'required|same:password', |
67 | 67 | '_user_token' => 'required', |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | public function resourceSave(Request $request) |
57 | 57 | { |
58 | 58 | //validate the request |
59 | - $this->validate(request(), [ //@todo create custom Request class for site validation |
|
59 | + $this->validate(request(), [//@todo create custom Request class for site validation |
|
60 | 60 | 'slug' => 'required', |
61 | 61 | 'resource_key.*' => 'required', |
62 | 62 | 'resource_value.*' => 'required' |
@@ -65,9 +65,9 @@ discard block |
||
65 | 65 | $resource = Resource::firstOrNew(['slug' => $request->get('slug')[0]]); |
66 | 66 | $resource->slug = $request->get('slug')[0]; |
67 | 67 | $json = []; |
68 | - foreach(ChuckSite::getSupportedLocales() as $langKey => $langValue){ |
|
68 | + foreach (ChuckSite::getSupportedLocales() as $langKey => $langValue) { |
|
69 | 69 | |
70 | - for ($i=0; $i < count($request->get('resource_key')[$langKey]); $i++) { |
|
70 | + for ($i = 0; $i < count($request->get('resource_key')[$langKey]); $i++) { |
|
71 | 71 | $json[$langKey][$request->get('resource_key')[$langKey][$i]] = $request->get('resource_value')[$langKey][$i]; |
72 | 72 | |
73 | 73 | } |
@@ -105,23 +105,23 @@ discard block |
||
105 | 105 | $content_slug = $request->get('content_slug'); |
106 | 106 | $fields_slug = $request->get('fields_slug'); |
107 | 107 | |
108 | - for ($i=0; $i < count($fields_slug); $i++) { |
|
109 | - $content['fields'][$content_slug.'_'.$fields_slug[$i]]['label'] = $request->get('fields_label')[$i]; |
|
110 | - $content['fields'][$content_slug.'_'.$fields_slug[$i]]['type'] = $request->get('fields_type')[$i]; |
|
111 | - $content['fields'][$content_slug.'_'.$fields_slug[$i]]['class'] = $request->get('fields_class')[$i]; |
|
112 | - $content['fields'][$content_slug.'_'.$fields_slug[$i]]['placeholder'] = $request->get('fields_placeholder')[$i]; |
|
113 | - $content['fields'][$content_slug.'_'.$fields_slug[$i]]['validation'] = $request->get('fields_validation')[$i]; |
|
114 | - $content['fields'][$content_slug.'_'.$fields_slug[$i]]['value'] = $request->get('fields_value')[$i]; |
|
108 | + for ($i = 0; $i < count($fields_slug); $i++) { |
|
109 | + $content['fields'][$content_slug . '_' . $fields_slug[$i]]['label'] = $request->get('fields_label')[$i]; |
|
110 | + $content['fields'][$content_slug . '_' . $fields_slug[$i]]['type'] = $request->get('fields_type')[$i]; |
|
111 | + $content['fields'][$content_slug . '_' . $fields_slug[$i]]['class'] = $request->get('fields_class')[$i]; |
|
112 | + $content['fields'][$content_slug . '_' . $fields_slug[$i]]['placeholder'] = $request->get('fields_placeholder')[$i]; |
|
113 | + $content['fields'][$content_slug . '_' . $fields_slug[$i]]['validation'] = $request->get('fields_validation')[$i]; |
|
114 | + $content['fields'][$content_slug . '_' . $fields_slug[$i]]['value'] = $request->get('fields_value')[$i]; |
|
115 | 115 | |
116 | - for ($k=0; $k < count(explode(';',$request->get('fields_attributes_name')[$i])); $k++) { |
|
117 | - $content['fields'][$content_slug . '_' . $fields_slug[$i]]['attributes'][explode(';',$request->get('fields_attributes_name')[$i])[$k]] = explode(';',$request->get('fields_attributes_value')[$i])[$k]; |
|
116 | + for ($k = 0; $k < count(explode(';', $request->get('fields_attributes_name')[$i])); $k++) { |
|
117 | + $content['fields'][$content_slug . '_' . $fields_slug[$i]]['attributes'][explode(';', $request->get('fields_attributes_name')[$i])[$k]] = explode(';', $request->get('fields_attributes_value')[$i])[$k]; |
|
118 | 118 | } |
119 | 119 | $content['fields'][$content_slug . '_' . $fields_slug[$i]]['required'] = $request->get('fields_required')[$i]; |
120 | 120 | $content['fields'][$content_slug . '_' . $fields_slug[$i]]['table'] = $request->get('fields_table')[$i]; |
121 | 121 | } |
122 | 122 | |
123 | 123 | $content['actions']['store'] = $request->get('action_store'); |
124 | - if($request->get('action_detail') == 'true') { |
|
124 | + if ($request->get('action_detail') == 'true') { |
|
125 | 125 | $content['actions']['detail']['url'] = $request->get('action_detail_url'); |
126 | 126 | $content['actions']['detail']['page'] = $request->get('action_detail_page'); |
127 | 127 | } else { |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | { |
146 | 146 | $content = Content::where('slug', $slug)->first(); |
147 | 147 | $repeaters = $this->repeater->where('slug', $slug)->get(); |
148 | - return view('chuckcms::backend.content.repeater.entries.index', compact('content','repeaters')); |
|
148 | + return view('chuckcms::backend.content.repeater.entries.index', compact('content', 'repeaters')); |
|
149 | 149 | } |
150 | 150 | |
151 | 151 | public function repeaterEntriesCreate($slug) |
@@ -161,9 +161,9 @@ discard block |
||
161 | 161 | $rules = $content->getRules(); |
162 | 162 | $this->validate(request(), $rules); |
163 | 163 | $store = $content->storeEntry($request); |
164 | - if($store == 'success'){ |
|
164 | + if ($store == 'success') { |
|
165 | 165 | return redirect()->route('dashboard.content.repeaters.entries', ['slug' => $slug]); |
166 | - }else { |
|
166 | + } else { |
|
167 | 167 | // error catching ... ? |
168 | 168 | } |
169 | 169 | } |
@@ -163,7 +163,7 @@ |
||
163 | 163 | $store = $content->storeEntry($request); |
164 | 164 | if($store == 'success'){ |
165 | 165 | return redirect()->route('dashboard.content.repeaters.entries', ['slug' => $slug]); |
166 | - }else { |
|
166 | + } else { |
|
167 | 167 | // error catching ... ? |
168 | 168 | } |
169 | 169 | } |
@@ -63,7 +63,7 @@ |
||
63 | 63 | |
64 | 64 | $page = $this->page->where('slug->'.app()->getLocale(), $slug)->first(); |
65 | 65 | if($page == null){ |
66 | - foreach(\LaravelLocalization::getSupportedLocales() as $localeCode => $properties){ |
|
66 | + foreach(\LaravelLocalization::getSupportedLocales() as $localeCode => $properties){ |
|
67 | 67 | $page = $this->page->where('slug->'.$localeCode, $slug)->first(); |
68 | 68 | if($page !== null && $localeCode == app()->getLocale()) break; |
69 | 69 |
@@ -45,45 +45,45 @@ discard block |
||
45 | 45 | |
46 | 46 | public function index($slug = null) |
47 | 47 | { |
48 | - if($slug == null){ |
|
48 | + if ($slug == null) { |
|
49 | 49 | $page = $this->page->where('isHp', 1)->firstOrFail(); |
50 | - } elseif($slug !== null){ |
|
50 | + } elseif ($slug !== null) { |
|
51 | 51 | |
52 | 52 | $redirect = $this->redirect->where('slug', $slug)->first(); |
53 | - if($redirect !== null){ |
|
53 | + if ($redirect !== null) { |
|
54 | 54 | return redirect($redirect->to, $redirect->type); |
55 | 55 | } |
56 | 56 | |
57 | 57 | $repeater = $this->repeater->where('url', $slug)->first(); |
58 | - if($repeater !== null){ |
|
58 | + if ($repeater !== null) { |
|
59 | 59 | $templateHintpath = explode('::', $repeater->page)[0]; |
60 | 60 | $template = $this->template->where('active', 1)->where('hintpath', $templateHintpath)->first(); |
61 | 61 | return view($repeater->page, compact('template', 'repeater')); |
62 | 62 | } |
63 | 63 | |
64 | - $page = $this->page->where('slug->'.app()->getLocale(), $slug)->first(); |
|
65 | - if($page == null){ |
|
66 | - foreach(\LaravelLocalization::getSupportedLocales() as $localeCode => $properties){ |
|
67 | - $page = $this->page->where('slug->'.$localeCode, $slug)->first(); |
|
68 | - if($page !== null && $localeCode == app()->getLocale()) break; |
|
64 | + $page = $this->page->where('slug->' . app()->getLocale(), $slug)->first(); |
|
65 | + if ($page == null) { |
|
66 | + foreach (\LaravelLocalization::getSupportedLocales() as $localeCode => $properties) { |
|
67 | + $page = $this->page->where('slug->' . $localeCode, $slug)->first(); |
|
68 | + if ($page !== null && $localeCode == app()->getLocale()) break; |
|
69 | 69 | |
70 | - if($page !== null && $localeCode !== app()->getLocale()){ |
|
70 | + if ($page !== null && $localeCode !== app()->getLocale()) { |
|
71 | 71 | //dd(app()->getLocale()); |
72 | 72 | app()->setLocale($localeCode); |
73 | 73 | \LaravelLocalization::setLocale($localeCode); |
74 | 74 | |
75 | - return redirect($localeCode.'/'.$slug); |
|
75 | + return redirect($localeCode . '/' . $slug); |
|
76 | 76 | } |
77 | 77 | } |
78 | 78 | } |
79 | 79 | |
80 | - if($page == null) abort(404); |
|
80 | + if ($page == null) abort(404); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | $ogpageblocks = $this->pageblock->getAllByPageId($page->id); |
84 | 84 | $pageblocks = $this->pageBlockRepository->getRenderedByPageBlocks($ogpageblocks); |
85 | 85 | |
86 | - if($page->page !== null) { |
|
86 | + if ($page->page !== null) { |
|
87 | 87 | $template = $this->template->where('active', 1)->where('hintpath', explode('::', $page->page)[0])->first(); |
88 | 88 | |
89 | 89 | return view($page->page, compact('template', 'page', 'pageblocks')); |
@@ -91,6 +91,6 @@ discard block |
||
91 | 91 | |
92 | 92 | $template = $this->template->where('active', 1)->where('id', $page->template_id)->first(); |
93 | 93 | |
94 | - return view($template->hintpath.'::templates.'.$template->slug.'.page', compact('template', 'page', 'pageblocks')); |
|
94 | + return view($template->hintpath . '::templates.' . $template->slug . '.page', compact('template', 'page', 'pageblocks')); |
|
95 | 95 | } |
96 | 96 | } |
@@ -65,7 +65,9 @@ discard block |
||
65 | 65 | if($page == null){ |
66 | 66 | foreach(\LaravelLocalization::getSupportedLocales() as $localeCode => $properties){ |
67 | 67 | $page = $this->page->where('slug->'.$localeCode, $slug)->first(); |
68 | - if($page !== null && $localeCode == app()->getLocale()) break; |
|
68 | + if($page !== null && $localeCode == app()->getLocale()) { |
|
69 | + break; |
|
70 | + } |
|
69 | 71 | |
70 | 72 | if($page !== null && $localeCode !== app()->getLocale()){ |
71 | 73 | //dd(app()->getLocale()); |
@@ -77,7 +79,9 @@ discard block |
||
77 | 79 | } |
78 | 80 | } |
79 | 81 | |
80 | - if($page == null) abort(404); |
|
82 | + if($page == null) { |
|
83 | + abort(404); |
|
84 | + } |
|
81 | 85 | } |
82 | 86 | |
83 | 87 | $ogpageblocks = $this->pageblock->getAllByPageId($page->id); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | $form_slug = $request->get('form_slug'); |
56 | 56 | $fields_slug = $request->get('fields_slug'); |
57 | 57 | |
58 | - for ($i=0; $i < count($fields_slug); $i++) { |
|
58 | + for ($i = 0; $i < count($fields_slug); $i++) { |
|
59 | 59 | $form['fields'][$form_slug . '_' . $fields_slug[$i]]['label'] = $request->get('fields_label')[$i]; |
60 | 60 | $form['fields'][$form_slug . '_' . $fields_slug[$i]]['type'] = $request->get('fields_type')[$i]; |
61 | 61 | $form['fields'][$form_slug . '_' . $fields_slug[$i]]['class'] = $request->get('fields_class')[$i]; |
@@ -64,15 +64,15 @@ discard block |
||
64 | 64 | $form['fields'][$form_slug . '_' . $fields_slug[$i]]['validation'] = $request->get('fields_validation')[$i]; |
65 | 65 | $form['fields'][$form_slug . '_' . $fields_slug[$i]]['value'] = $request->get('fields_value')[$i]; |
66 | 66 | |
67 | - for ($k=0; $k < count(explode(';',$request->get('fields_attributes_name')[$i])); $k++) { |
|
68 | - $form['fields'][$form_slug . '_' . $fields_slug[$i]]['attributes'][explode(';',$request->get('fields_attributes_name')[$i])[$k]] = explode(';',$request->get('fields_attributes_value')[$i])[$k]; |
|
67 | + for ($k = 0; $k < count(explode(';', $request->get('fields_attributes_name')[$i])); $k++) { |
|
68 | + $form['fields'][$form_slug . '_' . $fields_slug[$i]]['attributes'][explode(';', $request->get('fields_attributes_name')[$i])[$k]] = explode(';', $request->get('fields_attributes_value')[$i])[$k]; |
|
69 | 69 | } |
70 | 70 | $form['fields'][$form_slug . '_' . $fields_slug[$i]]['required'] = $request->get('fields_required')[$i]; |
71 | 71 | } |
72 | 72 | |
73 | 73 | $form['actions']['store'] = $request->get('action_store'); |
74 | - if($request->get('action_send') == true) { |
|
75 | - for ($g=0; $g < count($request->get('action_send_slug')); $g++) { |
|
74 | + if ($request->get('action_send') == true) { |
|
75 | + for ($g = 0; $g < count($request->get('action_send_slug')); $g++) { |
|
76 | 76 | $form['actions']['send'][$request->get('action_send_slug')[$g]]['to'] = $request->get('action_send_to')[$g]; |
77 | 77 | $form['actions']['send'][$request->get('action_send_slug')[$g]]['to_name'] = $request->get('action_send_to_name')[$g]; |
78 | 78 | $form['actions']['send'][$request->get('action_send_slug')[$g]]['from'] = $request->get('action_send_from')[$g]; |
@@ -110,14 +110,14 @@ discard block |
||
110 | 110 | $rules = $form->getRules(); |
111 | 111 | $this->validate(request(), $rules); |
112 | 112 | $store = $form->storeEntry($request); |
113 | - if($store !== 'error'){ |
|
113 | + if ($store !== 'error') { |
|
114 | 114 | //send emails |
115 | - foreach($form->form['actions']['send'] as $sendKey => $sendValue){ |
|
115 | + foreach ($form->form['actions']['send'] as $sendKey => $sendValue) { |
|
116 | 116 | $mailData = $form->getMailData($sendValue, $request, $store); |
117 | 117 | Mail::send(new FormActionMail($mailData)); |
118 | 118 | } |
119 | 119 | return redirect()->to($form->form['actions']['redirect']); |
120 | - }else { |
|
120 | + } else { |
|
121 | 121 | // error catching ... ? |
122 | 122 | } |
123 | 123 |
@@ -117,7 +117,7 @@ |
||
117 | 117 | Mail::send(new FormActionMail($mailData)); |
118 | 118 | } |
119 | 119 | return redirect()->to($form->form['actions']['redirect']); |
120 | - }else { |
|
120 | + } else { |
|
121 | 121 | // error catching ... ? |
122 | 122 | } |
123 | 123 |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | |
45 | 45 | public function invite(Request $request) |
46 | 46 | { |
47 | - $this->validate(request(), [ //@todo create custom Request class for page validation |
|
47 | + $this->validate(request(), [//@todo create custom Request class for page validation |
|
48 | 48 | 'name' => 'max:185|required', |
49 | 49 | 'email' => 'email|required|unique:users', |
50 | 50 | 'role' => 'required|in:user,moderator,administrator,super-admin' |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | |
93 | 93 | public function activate(Request $request) |
94 | 94 | { |
95 | - $this->validate(request(), [ //@todo create custom Request class for user password validation |
|
95 | + $this->validate(request(), [//@todo create custom Request class for user password validation |
|
96 | 96 | 'password' => 'required|min:8|regex:/^.*(?=.{3,})(?=.*[a-zA-Z])(?=.*[0-9])(?=.*[\d\X])(?=.*[!$#%]).*$/', |
97 | 97 | 'password_again' => 'required|same:password', |
98 | 98 | '_user_token' => 'required', |
@@ -130,14 +130,14 @@ discard block |
||
130 | 130 | |
131 | 131 | public function save(Request $request) |
132 | 132 | { |
133 | - $this->validate(request(), [ //@todo create custom Request class for page validation |
|
133 | + $this->validate(request(), [//@todo create custom Request class for page validation |
|
134 | 134 | 'name' => 'max:185|required', |
135 | 135 | 'email' => 'email|required', |
136 | 136 | 'role' => 'required|in:user,moderator,administrator,super-admin' |
137 | 137 | ]); |
138 | 138 | |
139 | 139 | // update the user |
140 | - $user = $this->user->create([ // TODO CHANGE TO UPDATE METHOD |
|
140 | + $user = $this->user->create([// TODO CHANGE TO UPDATE METHOD |
|
141 | 141 | 'name' => $request->get('name'), |
142 | 142 | 'email' => $request->get('email'), |
143 | 143 | 'token' => $this->userRepository->createToken(), |
@@ -10,24 +10,24 @@ |
||
10 | 10 | |
11 | 11 | class Page extends Eloquent |
12 | 12 | { |
13 | - use HasTranslations; |
|
13 | + use HasTranslations; |
|
14 | 14 | |
15 | 15 | public function template(){ |
16 | - return $this->belongsTo('Chuckbe\Chuckcms\Models\Template'); |
|
16 | + return $this->belongsTo('Chuckbe\Chuckcms\Models\Template'); |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | public function page_blocks(){ |
20 | - return $this->hasMany('Chuckbe\Chuckcms\Models\PageBlock')->orderBy('order'); |
|
20 | + return $this->hasMany('Chuckbe\Chuckcms\Models\PageBlock')->orderBy('order'); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | public function getById($id) |
24 | 24 | { |
25 | - return $this->where('id', $id)->first(); |
|
25 | + return $this->where('id', $id)->first(); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | public function getByIdWithBlocks($id) |
29 | 29 | { |
30 | - return $this->where('id', $id)->with('page_blocks')->first(); |
|
30 | + return $this->where('id', $id)->with('page_blocks')->first(); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | public function create($values) |
@@ -12,11 +12,11 @@ discard block |
||
12 | 12 | { |
13 | 13 | use HasTranslations; |
14 | 14 | |
15 | - public function template(){ |
|
15 | + public function template() { |
|
16 | 16 | return $this->belongsTo('Chuckbe\Chuckcms\Models\Template'); |
17 | 17 | } |
18 | 18 | |
19 | - public function page_blocks(){ |
|
19 | + public function page_blocks() { |
|
20 | 20 | return $this->hasMany('Chuckbe\Chuckcms\Models\PageBlock')->orderBy('order'); |
21 | 21 | } |
22 | 22 | |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | $page = new Page(); |
36 | 36 | |
37 | 37 | $meta = []; |
38 | - foreach(ChuckSite::getSupportedLocales() as $langKey => $langValue){ |
|
38 | + foreach (ChuckSite::getSupportedLocales() as $langKey => $langValue) { |
|
39 | 39 | $page->setTranslation('title', $langKey, $values->get('page_title')[$langKey]); |
40 | 40 | $page->setTranslation('slug', $langKey, $values->get('page_slug')[$langKey]); |
41 | 41 | |
@@ -47,13 +47,13 @@ discard block |
||
47 | 47 | $meta[$langKey]['og-title'] = $values->get('meta_title')[$langKey]; |
48 | 48 | $meta[$langKey]['og-description'] = $values->get('meta_description')[$langKey]; |
49 | 49 | $meta[$langKey]['og-site_name'] = $values->get('meta_title')[$langKey]; |
50 | - if($values->get('meta_robots_index')[$langKey] == '1') { |
|
50 | + if ($values->get('meta_robots_index')[$langKey] == '1') { |
|
51 | 51 | $index = 'index, '; |
52 | 52 | } else { |
53 | 53 | $index = 'noindex, '; |
54 | 54 | } |
55 | 55 | |
56 | - if($values->get('meta_robots_follow')[$langKey] == '1') { |
|
56 | + if ($values->get('meta_robots_follow')[$langKey] == '1') { |
|
57 | 57 | $follow = 'follow'; |
58 | 58 | } else { |
59 | 59 | $follow = 'nofollow'; |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | |
62 | 62 | $meta[$langKey]['robots'] = $index . $follow; |
63 | 63 | $meta[$langKey]['googlebots'] = $index . $follow; |
64 | - for ($i=0; $i < count($values->get('meta_key')[$langKey]); $i++) { |
|
64 | + for ($i = 0; $i < count($values->get('meta_key')[$langKey]); $i++) { |
|
65 | 65 | $meta[$langKey][$values->get('meta_key')[$langKey][$i]] = $values->get('meta_value')[$langKey][$i]; |
66 | 66 | } |
67 | 67 | } |
@@ -80,10 +80,10 @@ discard block |
||
80 | 80 | $page = $this->getById($values['page_id']); |
81 | 81 | |
82 | 82 | $meta = []; |
83 | - foreach(ChuckSite::getSupportedLocales() as $langKey => $langValue){ |
|
83 | + foreach (ChuckSite::getSupportedLocales() as $langKey => $langValue) { |
|
84 | 84 | $page->setTranslation('title', $langKey, $values->get('page_title')[$langKey]); |
85 | 85 | $page->setTranslation('slug', $langKey, $values->get('page_slug')[$langKey]); |
86 | - for ($i=0; $i < count($values->get('meta_key')[$langKey]); $i++) { |
|
86 | + for ($i = 0; $i < count($values->get('meta_key')[$langKey]); $i++) { |
|
87 | 87 | $meta[$langKey][$values->get('meta_key')[$langKey][$i]] = $values->get('meta_value')[$langKey][$i]; |
88 | 88 | } |
89 | 89 | } |
@@ -100,9 +100,9 @@ discard block |
||
100 | 100 | public function deleteById($id) |
101 | 101 | { |
102 | 102 | $page = $this->where('id', $id)->first(); |
103 | - if($page){ |
|
103 | + if ($page) { |
|
104 | 104 | PageBlock::where('page_id', $page->id)->delete(); |
105 | - if($page->delete()){ |
|
105 | + if ($page->delete()) { |
|
106 | 106 | return 'success'; |
107 | 107 | } else { |
108 | 108 | return 'error'; |
@@ -24,14 +24,14 @@ |
||
24 | 24 | |
25 | 25 | public function getRenderedById($pageblock_id) |
26 | 26 | { |
27 | - $pageblock = $this->where('id', $pageblock_id)->first(); |
|
28 | - $new_pageblock = PageBlockRepository::getRenderedByPageBlock($pageblock); |
|
29 | - return $new_pageblock; |
|
27 | + $pageblock = $this->where('id', $pageblock_id)->first(); |
|
28 | + $new_pageblock = PageBlockRepository::getRenderedByPageBlock($pageblock); |
|
29 | + return $new_pageblock; |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | public function getById($id) |
33 | 33 | { |
34 | - return $this->find($id); |
|
34 | + return $this->find($id); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | public function getCountByPageId($page_id) |
@@ -9,8 +9,8 @@ |
||
9 | 9 | protected $table = 'menus'; |
10 | 10 | |
11 | 11 | public function __construct( array $attributes = [] ){ |
12 | - //parent::construct( $attributes ); |
|
13 | - $this->table = config('menu.table_prefix') . config('menu.table_name_menus'); |
|
12 | + //parent::construct( $attributes ); |
|
13 | + $this->table = config('menu.table_prefix') . config('menu.table_name_menus'); |
|
14 | 14 | } |
15 | 15 | |
16 | 16 | public static function byName($name) |
@@ -8,7 +8,7 @@ |
||
8 | 8 | { |
9 | 9 | protected $table = 'menus'; |
10 | 10 | |
11 | - public function __construct( array $attributes = [] ){ |
|
11 | + public function __construct(array $attributes = []) { |
|
12 | 12 | //parent::construct( $attributes ); |
13 | 13 | $this->table = config('menu.table_prefix') . config('menu.table_name_menus'); |
14 | 14 | } |