Completed
Pull Request — master (#85)
by Luke
02:39
created
src/LaraCart.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -70,8 +70,8 @@  discard block
 block discarded – undo
70 70
      */
71 71
     public function get($instance = 'default')
72 72
     {
73
-        if(config('laracart.cross_devices', false)) {
74
-            if(!empty($cartSessionID = $this->authManager->user()->cart_session_id)) {
73
+        if (config('laracart.cross_devices', false)) {
74
+            if (!empty($cartSessionID = $this->authManager->user()->cart_session_id)) {
75 75
                 $this->session->setId($cartSessionID);
76 76
                 $this->session->start();
77 77
             }
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
     {
128 128
         $this->session->set(config('laracart.cache_prefix', 'laracart') . '.' . $this->cart->instance, $this->cart);
129 129
 
130
-        if(config('laracart.cross_devices', false)) {
130
+        if (config('laracart.cross_devices', false)) {
131 131
             $this->authManager->user()->update([
132 132
                 'cart_session_id',
133 133
                 $this->session->getId()
Please login to merge, or discard this patch.
src/LaraCartServiceProvider.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
         );
31 31
 
32 32
         $this->publishes([
33
-                __DIR__.'/database/migrations/' => database_path('migrations')
33
+                __DIR__ . '/database/migrations/' => database_path('migrations')
34 34
             ], 'migrations'
35 35
         );
36 36
     }
@@ -42,21 +42,21 @@  discard block
 block discarded – undo
42 42
      */
43 43
     public function register()
44 44
     {
45
-        $this->app->singleton(LaraCart::SERVICE, function ($app) {
45
+        $this->app->singleton(LaraCart::SERVICE, function($app) {
46 46
             return new LaraCart($app['session'], $app['events'], $app['auth']);
47 47
         }
48 48
         );
49 49
 
50 50
         $this->app->bind(
51 51
             LaraCart::HASH,
52
-            function ($app, $data) {
52
+            function($app, $data) {
53 53
                 return md5(json_encode($data));
54 54
             }
55 55
         );
56 56
 
57 57
         $this->app->bind(
58 58
             LaraCart::RANHASH,
59
-            function () {
59
+            function() {
60 60
                 return str_random(40);
61 61
             }
62 62
         );
Please login to merge, or discard this patch.
database/migrations/2000_01_1_195953_add_cart_session_id_to_users_table.php 1 patch
Spacing   +2 added lines, -2 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
         if (!(Schema::hasColumn('users', 'cart_session_id'))) {
16
-            Schema::table('users', function (Blueprint $table) {
16
+            Schema::table('users', function(Blueprint $table) {
17 17
                 $table->string('cart_session_id')->default(null);
18 18
             });
19 19
         }
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
     public function down()
28 28
     {
29 29
         if ((Schema::hasColumn('users', 'cart_session_id'))) {
30
-            Schema::table('users', function (Blueprint $table) {
30
+            Schema::table('users', function(Blueprint $table) {
31 31
                 $table->dropColumn('cart_session_id');
32 32
             });
33 33
         }
Please login to merge, or discard this patch.