@@ -23,7 +23,7 @@ |
||
23 | 23 | public function index(Request $request) |
24 | 24 | { |
25 | 25 | $parent = $request->get('term_id') ?? 0; |
26 | - if($request->has('taxonomy')) { |
|
26 | + if ($request->has('taxonomy')) { |
|
27 | 27 | $taxonomy = $request->taxonomy; |
28 | 28 | } else { |
29 | 29 | $taxonomy = 'rt_data_structure'; |
@@ -57,7 +57,7 @@ |
||
57 | 57 | 'post_mime_type' => '', |
58 | 58 | // 'post_name' => $request->get('slug') |
59 | 59 | ]); |
60 | - $guid = option('site_url') . "/post/{$post->id}"; |
|
60 | + $guid = option('site_url')."/post/{$post->id}"; |
|
61 | 61 | $post->guid = $guid; |
62 | 62 | $post->save(); |
63 | 63 |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | |
10 | 10 | public function ago() |
11 | 11 | { |
12 | - if(!$this->created_at) { |
|
12 | + if ( ! $this->created_at) { |
|
13 | 13 | return 'n/a'; |
14 | 14 | } |
15 | 15 | $time = Carbon::parse($this->created_at); |
@@ -34,13 +34,13 @@ discard block |
||
34 | 34 | $day = $time->format('d'); |
35 | 35 | // return $intervals[1][0]; |
36 | 36 | if ($ago == '1 day') { |
37 | - return 'Yesterday at ' . $time->format('H:i'); |
|
37 | + return 'Yesterday at '.$time->format('H:i'); |
|
38 | 38 | } elseif ($value <= 59 && $intervals[1][0] == 'second' || $intervals[1][0] == 'min' || $intervals[1][0] == 'hr') { |
39 | 39 | return $ago; |
40 | - } elseif($time->year == Carbon::now()->year) { |
|
41 | - return $time->format('M d') . ' at ' . $time->format('H:i'); |
|
40 | + } elseif ($time->year == Carbon::now()->year) { |
|
41 | + return $time->format('M d').' at '.$time->format('H:i'); |
|
42 | 42 | } else { |
43 | - return $time->format('M d, Y') . ' at ' . $time->format('H:i'); |
|
43 | + return $time->format('M d, Y').' at '.$time->format('H:i'); |
|
44 | 44 | } |
45 | 45 | } |
46 | 46 | } |
47 | 47 | \ No newline at end of file |
@@ -1,30 +1,30 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | // Home |
4 | -Breadcrumbs::for('home', function ($trail) { |
|
4 | +Breadcrumbs::for ('home', function($trail) { |
|
5 | 5 | $trail->push('Home', route('home')); |
6 | 6 | }); |
7 | 7 | |
8 | 8 | // Home > About |
9 | -Breadcrumbs::for('about', function ($trail) { |
|
9 | +Breadcrumbs::for ('about', function($trail) { |
|
10 | 10 | $trail->parent('home'); |
11 | 11 | $trail->push('About', route('about')); |
12 | 12 | }); |
13 | 13 | |
14 | 14 | // Home > Blog |
15 | -Breadcrumbs::for('blog', function ($trail) { |
|
15 | +Breadcrumbs::for ('blog', function($trail) { |
|
16 | 16 | $trail->parent('home'); |
17 | 17 | $trail->push('Blog', route('blog')); |
18 | 18 | }); |
19 | 19 | |
20 | 20 | // Home > Blog > [Category] |
21 | -Breadcrumbs::for('category', function ($trail, $category) { |
|
21 | +Breadcrumbs::for ('category', function($trail, $category) { |
|
22 | 22 | $trail->parent('blog'); |
23 | 23 | $trail->push($category->title, route('category', $category->id)); |
24 | 24 | }); |
25 | 25 | |
26 | 26 | // Home > Blog > [Category] > [Post] |
27 | -Breadcrumbs::for('post', function ($trail, $post) { |
|
27 | +Breadcrumbs::for ('post', function($trail, $post) { |
|
28 | 28 | $trail->parent('category', $post->category); |
29 | 29 | $trail->push($post->title, route('post', $post->id)); |
30 | 30 | }); |
31 | 31 | \ No newline at end of file |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | 'middleware' => 'web', |
6 | 6 | 'prefix' => config('starter-kit.routes.prefix', 'rt-admin'), |
7 | 7 | 'namespace' => 'Raystech\StarterKit\Http\Controllers' |
8 | -], function(){ |
|
8 | +], function() { |
|
9 | 9 | |
10 | 10 | Route::get('ping', function() { |
11 | 11 | $config = config('starter-kit'); |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | return 'received'; |
14 | 14 | }); |
15 | 15 | |
16 | - Route::resource('posts','PostController', [ 'as' => config('starter-kit.routes.name_prefix', 'rt-admin') ]); |
|
17 | - Route::resource('terms','TermController', [ 'as' => config('starter-kit.routes.name_prefix', 'rt-admin') ]); |
|
16 | + Route::resource('posts', 'PostController', ['as' => config('starter-kit.routes.name_prefix', 'rt-admin')]); |
|
17 | + Route::resource('terms', 'TermController', ['as' => config('starter-kit.routes.name_prefix', 'rt-admin')]); |
|
18 | 18 | |
19 | 19 | }); |
20 | 20 | \ No newline at end of file |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | ]; |
23 | 23 | |
24 | 24 | public function getAuthorName() { |
25 | - if($this->author) { |
|
25 | + if ($this->author) { |
|
26 | 26 | return $this->author->name; |
27 | 27 | } else { |
28 | 28 | return 'Unknown'; |
@@ -37,27 +37,27 @@ discard block |
||
37 | 37 | { |
38 | 38 | parent::boot(); |
39 | 39 | |
40 | - self::creating(function($model){ |
|
40 | + self::creating(function($model) { |
|
41 | 41 | // ... code here |
42 | 42 | }); |
43 | 43 | |
44 | - self::created(function($model){ |
|
44 | + self::created(function($model) { |
|
45 | 45 | // ... code here |
46 | 46 | }); |
47 | 47 | |
48 | - self::updating(function($model){ |
|
48 | + self::updating(function($model) { |
|
49 | 49 | // ... code here |
50 | 50 | }); |
51 | 51 | |
52 | - self::updated(function($model){ |
|
52 | + self::updated(function($model) { |
|
53 | 53 | // ... code here |
54 | 54 | }); |
55 | 55 | |
56 | - self::deleting(function($model){ |
|
56 | + self::deleting(function($model) { |
|
57 | 57 | // ... code here |
58 | 58 | }); |
59 | 59 | |
60 | - self::deleted(function($model){ |
|
60 | + self::deleted(function($model) { |
|
61 | 61 | // ... code here |
62 | 62 | }); |
63 | 63 | } |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | return [ |
68 | 68 | 'post_name' => [ |
69 | 69 | 'source' => 'post_title', |
70 | - 'method' => function ($string, $separator) { |
|
70 | + 'method' => function($string, $separator) { |
|
71 | 71 | return $this->slugify_th($string, $separator); |
72 | 72 | } |
73 | 73 | ] |
@@ -1,17 +1,17 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (!function_exists('menuIsRoute')) { |
|
3 | +if ( ! function_exists('menuIsRoute')) { |
|
4 | 4 | function menuIsRoute($route, $active_class = 'active') { |
5 | 5 | $curr_route = Route::currentRouteName(); |
6 | - if($route == $curr_route) { |
|
6 | + if ($route == $curr_route) { |
|
7 | 7 | return $active_class; |
8 | 8 | } |
9 | 9 | } |
10 | 10 | } |
11 | 11 | |
12 | -if (!function_exists('urlDoesContainParam')) { |
|
12 | +if ( ! function_exists('urlDoesContainParam')) { |
|
13 | 13 | function urlDoesContainParam($param_name, $param_value = true, $active_class = 'active') { |
14 | - if(request()->get($param_name) == $param_value) { |
|
14 | + if (request()->get($param_name) == $param_value) { |
|
15 | 15 | return $active_class; |
16 | 16 | } |
17 | 17 | } |