@@ -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 |
@@ -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,56 +1,56 @@ |
||
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 | // Property |
9 | -Breadcrumbs::for('rt-admin.posts.index', function ($trail) { |
|
9 | +Breadcrumbs::for ('rt-admin.posts.index', function($trail) { |
|
10 | 10 | $trail->parent('home'); |
11 | 11 | $trail->push('Properties', route('rt-admin.posts.index')); |
12 | 12 | }); |
13 | 13 | |
14 | 14 | // Property > Add New |
15 | -Breadcrumbs::for('rt-admin.posts.create', function ($trail) { |
|
15 | +Breadcrumbs::for ('rt-admin.posts.create', function($trail) { |
|
16 | 16 | $trail->parent('home'); |
17 | 17 | $trail->push('Properties', route('rt-admin.posts.index')); |
18 | 18 | $trail->push('Add New', route('rt-admin.posts.index')); |
19 | 19 | }); |
20 | 20 | |
21 | 21 | // Property > Show |
22 | -Breadcrumbs::for('rt-admin.posts.show', function ($trail, $post) { |
|
22 | +Breadcrumbs::for ('rt-admin.posts.show', function($trail, $post) { |
|
23 | 23 | $trail->parent('home'); |
24 | 24 | $trail->push('Properties', route('rt-admin.posts.index')); |
25 | 25 | $trail->push($post->post_title, route('rt-admin.posts.index')); |
26 | 26 | }); |
27 | 27 | |
28 | 28 | // Term |
29 | -Breadcrumbs::for('rt-admin.terms.index', function ($trail) { |
|
29 | +Breadcrumbs::for ('rt-admin.terms.index', function($trail) { |
|
30 | 30 | $trail->parent('home'); |
31 | 31 | $trail->push('Term : '.title_case(request()->get('taxonomy')), route('rt-admin.terms.index')); |
32 | 32 | }); |
33 | 33 | |
34 | 34 | // Home > About |
35 | -Breadcrumbs::for('about', function ($trail) { |
|
35 | +Breadcrumbs::for ('about', function($trail) { |
|
36 | 36 | $trail->parent('home'); |
37 | 37 | $trail->push('About', route('about')); |
38 | 38 | }); |
39 | 39 | |
40 | 40 | // Home > Blog |
41 | -Breadcrumbs::for('blog', function ($trail) { |
|
41 | +Breadcrumbs::for ('blog', function($trail) { |
|
42 | 42 | $trail->parent('home'); |
43 | 43 | $trail->push('Blog', route('blog')); |
44 | 44 | }); |
45 | 45 | |
46 | 46 | // Home > Blog > [Category] |
47 | -Breadcrumbs::for('category', function ($trail, $category) { |
|
47 | +Breadcrumbs::for ('category', function($trail, $category) { |
|
48 | 48 | $trail->parent('blog'); |
49 | 49 | $trail->push($category->title, route('category', $category->id)); |
50 | 50 | }); |
51 | 51 | |
52 | 52 | // Home > Blog > [Category] > [Post] |
53 | -Breadcrumbs::for('post', function ($trail, $post) { |
|
53 | +Breadcrumbs::for ('post', function($trail, $post) { |
|
54 | 54 | $trail->parent('category', $post->category); |
55 | 55 | $trail->push($post->title, route('post', $post->id)); |
56 | 56 | }); |
57 | 57 | \ No newline at end of file |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | |
4 | -if (! function_exists('flashtoast')) { |
|
4 | +if ( ! function_exists('flashtoast')) { |
|
5 | 5 | /** |
6 | 6 | * Arrange for a flash message. |
7 | 7 | * |
@@ -12,25 +12,25 @@ discard block |
||
12 | 12 | function flashtoast($message = null, $level = 'info') |
13 | 13 | { |
14 | 14 | $notifier = app('flashtoast'); |
15 | - if (! is_null($message)) { |
|
15 | + if ( ! is_null($message)) { |
|
16 | 16 | return $notifier->message($message, $level); |
17 | 17 | } |
18 | 18 | return $notifier; |
19 | 19 | } |
20 | 20 | } |
21 | 21 | |
22 | -if (!function_exists('menuIsRoute')) { |
|
22 | +if ( ! function_exists('menuIsRoute')) { |
|
23 | 23 | function menuIsRoute($route, $active_class = 'active') { |
24 | 24 | $curr_route = Route::currentRouteName(); |
25 | - if($route == $curr_route) { |
|
25 | + if ($route == $curr_route) { |
|
26 | 26 | return $active_class; |
27 | 27 | } |
28 | 28 | } |
29 | 29 | } |
30 | 30 | |
31 | -if (!function_exists('urlDoesContainParam')) { |
|
31 | +if ( ! function_exists('urlDoesContainParam')) { |
|
32 | 32 | function urlDoesContainParam($param_name, $param_value = true, $active_class = 'active') { |
33 | - if(request()->get($param_name) == $param_value) { |
|
33 | + if (request()->get($param_name) == $param_value) { |
|
34 | 34 | return $active_class; |
35 | 35 | } |
36 | 36 | } |
@@ -82,10 +82,10 @@ discard block |
||
82 | 82 | { |
83 | 83 | // If no message was provided, we should update |
84 | 84 | // the most recently added message. |
85 | - if (! $message) { |
|
85 | + if ( ! $message) { |
|
86 | 86 | return $this->updateLastMessage(compact('level')); |
87 | 87 | } |
88 | - if (! $message instanceof Message) { |
|
88 | + if ( ! $message instanceof Message) { |
|
89 | 89 | $message = new Message(compact('message', 'level')); |
90 | 90 | } |
91 | 91 | $this->messages->push($message); |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | */ |
112 | 112 | public function overlay($message = null, $title = 'Notice') |
113 | 113 | { |
114 | - if (! $message) { |
|
114 | + if ( ! $message) { |
|
115 | 115 | return $this->updateLastMessage(['title' => $title, 'overlay' => true]); |
116 | 116 | } |
117 | 117 | return $this->message( |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | public function boot() |
15 | 15 | { |
16 | 16 | // $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'raystech'); |
17 | - if(config('starter-kit.route_enable', false)) { |
|
17 | + if (config('starter-kit.route_enable', false)) { |
|
18 | 18 | $this->loadRoutesFrom(__DIR__.'/Routes/web.php'); |
19 | 19 | } |
20 | 20 | $this->loadHelpers(); |
@@ -66,10 +66,10 @@ discard block |
||
66 | 66 | // Publishing the configuration file. |
67 | 67 | // echo "Publishing StarterKit Config ...\n"; |
68 | 68 | $this->publishes([ |
69 | - __DIR__ . '/../config/starter-kit.php' => config_path('starter-kit.php'), |
|
69 | + __DIR__.'/../config/starter-kit.php' => config_path('starter-kit.php'), |
|
70 | 70 | ], 'config'); |
71 | 71 | |
72 | - $this->mergeConfigFrom(__DIR__ . '/../config/starter-kit.php', 'StarterKit'); |
|
72 | + $this->mergeConfigFrom(__DIR__.'/../config/starter-kit.php', 'StarterKit'); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | /** |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | public function register() |
81 | 81 | { |
82 | 82 | // Register the service the package provides. |
83 | - $this->app->singleton('StarterKit', function ($app) { |
|
83 | + $this->app->singleton('StarterKit', function($app) { |
|
84 | 84 | return new StarterKit; |
85 | 85 | }); |
86 | 86 | |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | ); |
93 | 93 | |
94 | 94 | // Register Flash Toast |
95 | - $this->app->singleton('flashtoast', function () { |
|
95 | + $this->app->singleton('flashtoast', function() { |
|
96 | 96 | return $this->app->make('RaysTech\StarterKit\Supports\FlashToast'); |
97 | 97 | }); |
98 | 98 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | } |
109 | 109 | |
110 | 110 | public function loadHelpers() { |
111 | - foreach (glob(__DIR__ . '/Helpers/*.php') as $filename) { |
|
111 | + foreach (glob(__DIR__.'/Helpers/*.php') as $filename) { |
|
112 | 112 | require_once($filename); |
113 | 113 | } |
114 | 114 | } |