Completed
Push — master ( 876046...6e04bc )
by Joao
02:55
created
src/Migrations/2016_01_15_123600_create_blog_tables.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
     public function up()
14 14
     {
15 15
 
16
-        Schema::create('BlogCategory', function (Blueprint $table) {
16
+        Schema::create('BlogCategory', function(Blueprint $table) {
17 17
             $table->increments('id');
18 18
             $table->string('name', 100);
19 19
             $table->string('slug', 100);
@@ -24,11 +24,11 @@  discard block
 block discarded – undo
24 24
             $table->creation();
25 25
         });
26 26
 
27
-        Schema::table('BlogCategory', function (Blueprint $table) {
27
+        Schema::table('BlogCategory', function(Blueprint $table) {
28 28
             $table->creationRelation();
29 29
         });
30 30
 
31
-        Schema::create('BlogPost', function (Blueprint $table) {
31
+        Schema::create('BlogPost', function(Blueprint $table) {
32 32
             $table->increments('id');
33 33
             $table->string('title', 100);
34 34
             $table->string('slug', 100);
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
             $table->foreign('author')->references('id')->on('User');
49 49
         });
50 50
 
51
-        Schema::table('BlogPost', function (Blueprint $table) {
51
+        Schema::table('BlogPost', function(Blueprint $table) {
52 52
             $table->creationRelation();
53 53
         });
54 54
 
Please login to merge, or discard this patch.
src/blogServiceProvider.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -40,17 +40,17 @@  discard block
 block discarded – undo
40 40
         // Publish our views
41 41
         $this->loadViewsFrom(base_path("resources/views"), 'base');
42 42
         $this->publishes([
43
-            __DIR__ .  '/views' => base_path("resources/views")
43
+            __DIR__ . '/views' => base_path("resources/views")
44 44
         ]);
45 45
 
46 46
         // Publish our lang
47 47
         $this->publishes([
48
-            __DIR__ .  '/lang' => base_path("resources/lang")
48
+            __DIR__ . '/lang' => base_path("resources/lang")
49 49
         ], 'migrations');
50 50
 
51 51
         // Publish our migrations
52 52
         $this->publishes([
53
-            __DIR__ .  '/migrations' => base_path("database/migrations")
53
+            __DIR__ . '/migrations' => base_path("database/migrations")
54 54
         ], 'migrations');
55 55
 
56 56
         // Publish a config file
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 
61 61
         // Publish our routes
62 62
         $this->publishes([
63
-            __DIR__ .  '/routes.php' => base_path("app/Http/base_routes.php")
63
+            __DIR__ . '/routes.php' => base_path("app/Http/base_routes.php")
64 64
         ], 'routes');
65 65
     }
66 66
 
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
      */
72 72
     protected function registerBlogPost()
73 73
     {
74
-        $this->app->singleton('jlourenco.blog.post', function ($app) {
74
+        $this->app->singleton('jlourenco.blog.post', function($app) {
75 75
             $baseConfig = $app['config']->get('jlourenco.base');
76 76
             $config = $app['config']->get('jlourenco.blog');
77 77
 
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
      */
97 97
     protected function registerBlogCategory()
98 98
     {
99
-        $this->app->singleton('jlourenco.blog.category', function ($app) {
99
+        $this->app->singleton('jlourenco.blog.category', function($app) {
100 100
             $config = $app['config']->get('jlourenco.blog');
101 101
 
102 102
             $model = array_get($config, 'models.BlogCategory');
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
      */
117 117
     protected function registerBlog()
118 118
     {
119
-        $this->app->singleton('blog', function ($app) {
119
+        $this->app->singleton('blog', function($app) {
120 120
             $blog = new Blog($app['jlourenco.blog.post'], $app['jlourenco.blog.category']);
121 121
 
122 122
             return $blog;
Please login to merge, or discard this patch.
src/routes.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
  * All the "restricted area" routes
6 6
  * are defined here.
7 7
  */
8
-Route::group(array('prefix' => '/', 'middleware' => 'webPublic'), function ()
8
+Route::group(array('prefix' => '/', 'middleware' => 'webPublic'), function()
9 9
 {
10 10
 
11 11
     # Blog pages
Please login to merge, or discard this patch.
src/Controllers/BlogController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 
34 34
     public function update($id, Request $request)
35 35
     {
36
-        $this->validate($request, [ 'value' => 'required' ]);
36
+        $this->validate($request, ['value' => 'required']);
37 37
 
38 38
         $move = Blog::getPostsRepository()->findOrFail($id);
39 39
 
@@ -87,16 +87,16 @@  discard block
 block discarded – undo
87 87
         $categories = $this->applySearch(Blog::getCategoriesRepository(), $terms, ['name', 'description'])->select('name as a', DB::raw('\'Category\' AS type'))->distinct()->get()->toArray();
88 88
 
89 89
         // Returning the results
90
-        return response()->json( [ 'data' => array_merge($users, $categories, $posts) ] );
90
+        return response()->json(['data' => array_merge($users, $categories, $posts)]);
91 91
     }
92 92
 
93 93
     public function applySearch($repo, $terms, $fields)
94 94
     {
95
-        foreach($terms as $term)
96
-            foreach($fields as $field)
95
+        foreach ($terms as $term)
96
+            foreach ($fields as $field)
97 97
                 $repo = $repo->orWhere($field, 'LIKE', '%' . $term . '%');
98 98
 
99
-        foreach($repo as $data)
99
+        foreach ($repo as $data)
100 100
         {
101 101
             dd($repo);
102 102
         }
Please login to merge, or discard this patch.