Completed
Push — master ( 331c04...c1995e )
by vijay
83:10 queued 47:32
created
app/Http/Controllers/Auth/AuthController.php 2 patches
Doc Comments   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -39,8 +39,6 @@  discard block
 block discarded – undo
39 39
     /**
40 40
      * Create a new authentication controller instance.
41 41
      *
42
-     * @param \Illuminate\Contracts\Auth\Guard     $auth
43
-     * @param \Illuminate\Contracts\Auth\Registrar $registrar
44 42
      *
45 43
      * @return void
46 44
      */
@@ -64,7 +62,7 @@  discard block
 block discarded – undo
64 62
      *
65 63
      * @param \Illuminate\Http\Request $request
66 64
      *
67
-     * @return \Illuminate\Http\Response
65
+     * @return \Illuminate\Http\RedirectResponse
68 66
      */
69 67
     public function postLogin(Request $request) {
70 68
         $this->validate($request, [
@@ -112,7 +110,7 @@  discard block
 block discarded – undo
112 110
      *
113 111
      * @param \Illuminate\Http\Request $request
114 112
      *
115
-     * @return \Illuminate\Http\Response
113
+     * @return \Illuminate\Http\RedirectResponse|null
116 114
      */
117 115
     public function postRegister(ProfileRequest $request, User $user, AccountActivate $activate) {
118 116
         try {
@@ -159,6 +157,9 @@  discard block
 block discarded – undo
159 157
         }
160 158
     }
161 159
 
160
+    /**
161
+     * @param string $method
162
+     */
162 163
     public function sendActivation($email, $method, $str = '') {
163 164
         try {
164 165
             $user = new User();
@@ -401,6 +402,9 @@  discard block
 block discarded – undo
401 402
         return $manager;
402 403
     }
403 404
 
405
+    /**
406
+     * @param User $user
407
+     */
404 408
     public function accountManagerMail($user) {
405 409
         $manager = $user->manager()
406 410
                 ->select('first_name','last_name','email','mobile_code','mobile','skype')
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
             $to = $user->email;
189 189
             $subject = $template->name;
190 190
             $data = $template->data;
191
-            $replace = ['name' => $user->first_name . ' ' . $user->last_name, 'username' => $user->email, 'password' => $str, 'url' => $url];
191
+            $replace = ['name' => $user->first_name.' '.$user->last_name, 'username' => $user->email, 'password' => $str, 'url' => $url];
192 192
             $type = "";
193 193
             if ($template) {
194 194
                 $type_id = $template->type;
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
         if (\Session::has('session-url')) {
281 281
             $url = \Session::get('session-url');
282 282
 
283
-            return property_exists($this, 'redirectTo') ? $this->redirectTo : '/' . $url;
283
+            return property_exists($this, 'redirectTo') ? $this->redirectTo : '/'.$url;
284 284
         } else {
285 285
             return property_exists($this, 'redirectTo') ? $this->redirectTo : '/home';
286 286
         }
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 
289 289
     public function sendOtp($mobile, $code) {
290 290
         $client = new \GuzzleHttp\Client();
291
-        $number = $code . $mobile;
291
+        $number = $code.$mobile;
292 292
         $response = $client->request('GET', 'https://control.msg91.com/api/sendotp.php', [
293 293
             'query' => ['authkey' => '54870AO9t5ZB1IEY5913f8e2', 'mobile' => $number]
294 294
         ]);
@@ -309,9 +309,9 @@  discard block
 block discarded – undo
309 309
             $code = $request->input('code');
310 310
             $mobile = $request->input('mobile');
311 311
             $userid = $request->input('id');
312
-            $number = $code . $mobile;
312
+            $number = $code.$mobile;
313 313
             $result = $this->sendOtp($mobile, $code);
314
-            $response = ['type' => $result, 'user_id' => $userid, 'message' => 'OTP has been sent to ' . $number];
314
+            $response = ['type' => $result, 'user_id' => $userid, 'message' => 'OTP has been sent to '.$number];
315 315
             return response()->json($response);
316 316
         } catch (\Exception $ex) {
317 317
             $result = [$ex->getMessage()];
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
 
322 322
     public function verifyOtp($mobile, $code, $otp) {
323 323
         $client = new \GuzzleHttp\Client();
324
-        $number = $code . $mobile;
324
+        $number = $code.$mobile;
325 325
         $response = $client->request('GET', 'https://control.msg91.com/api/verifyRequestOTP.php', [
326 326
             'query' => ['authkey' => '54870AO9t5ZB1IEY5913f8e2', 'mobile' => $number, 'otp' => $otp]
327 327
         ]);
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
             $user = User::find($userid);
370 370
             $check = $this->checkVerify($user);
371 371
             $this->sendActivation($email, $request->method());
372
-            $response = ['type' => 'success', 'proceed' => $check, 'email' => $email, 'message' => 'Activation link has been sent to ' . $email];
372
+            $response = ['type' => 'success', 'proceed' => $check, 'email' => $email, 'message' => 'Activation link has been sent to '.$email];
373 373
             return response()->json($response);
374 374
         } catch (\Exception $ex) {
375 375
             $result = [$ex->getMessage()];
@@ -389,13 +389,13 @@  discard block
 block discarded – undo
389 389
     public function accountManager() {
390 390
         $manager = "";
391 391
         $users = new User();
392
-        $account_count = $users->select(\DB::raw("count('manager') as count"),'manager')
392
+        $account_count = $users->select(\DB::raw("count('manager') as count"), 'manager')
393 393
                 ->whereNotNull('manager')
394 394
                 ->groupBy('manager')
395
-                ->pluck('count','manager')
395
+                ->pluck('count', 'manager')
396 396
                 ->toArray()
397 397
                 ;
398
-        if($account_count){
398
+        if ($account_count) {
399 399
             $manager = array_keys($account_count, min($account_count))[0]; 
400 400
         }
401 401
         return $manager;
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
 
404 404
     public function accountManagerMail($user) {
405 405
         $manager = $user->manager()
406
-                ->select('first_name','last_name','email','mobile_code','mobile','skype')
406
+                ->select('first_name', 'last_name', 'email', 'mobile_code', 'mobile', 'skype')
407 407
                 ->first();
408 408
         if ($user && $user->role == 'user' && $manager) {
409 409
             $settings = new \App\Model\Common\Setting();
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
             $template_name = $template->name;
421 421
             $template_controller = new \App\Http\Controllers\Common\TemplateController();
422 422
             $replace = [
423
-                'name' => $user->first_name . " " . $user->last_name,
423
+                'name' => $user->first_name." ".$user->last_name,
424 424
                 'manager_first_name' => $manager->first_name,
425 425
                 'manager_last_name' => $manager->last_name,
426 426
                 'manager_email' => $manager->email,
Please login to merge, or discard this patch.
app/Http/Controllers/Order/Order.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,6 @@
 block discarded – undo
4 4
 
5 5
 use App\Http\Controllers\Controller;
6 6
 use App\Model\Order\Order;
7
-use App\Model\Payment\Plan;
8
-use App\User;
9 7
 
10 8
 class Order extends Controller {
11 9
 
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
         }
29 29
     }
30 30
     
31
-    public function getProduct(){
31
+    public function getProduct() {
32 32
         $order = $this->getOrder();
33 33
         if ($order) {
34 34
             $product = $order->product;
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
         }
37 37
     }
38 38
     
39
-    public function getPlan(){
39
+    public function getPlan() {
40 40
         $subscription = $this->getSubscription();
41 41
         if ($subscription) {
42 42
             $plan = $subscription->plan;
@@ -44,16 +44,16 @@  discard block
 block discarded – undo
44 44
         }
45 45
     }
46 46
     
47
-    public function subscriptionPeriod(){
47
+    public function subscriptionPeriod() {
48 48
         $days = "";
49 49
         $plan = $this->getPlan();
50
-        if($plan){
50
+        if ($plan) {
51 51
             $days = $plan->days;
52 52
         }
53 53
         return $days;
54 54
     }
55 55
     
56
-    public function version(){
56
+    public function version() {
57 57
         $subscription = $this->getSubscription();
58 58
         if ($subscription) {
59 59
             $version = $subscription->vesion;
@@ -63,36 +63,36 @@  discard block
 block discarded – undo
63 63
           
64 64
     }
65 65
     
66
-    public function isExpired(){
66
+    public function isExpired() {
67 67
         $expired = false;
68
-        $subscription  = $this->getSubscription();
69
-        if($subscription){
68
+        $subscription = $this->getSubscription();
69
+        if ($subscription) {
70 70
             $end = $subscription->ends_at;
71 71
             $today = \Carbon\Carbon::now();
72
-            if($today->gt($end)){
72
+            if ($today->gt($end)) {
73 73
                 $expired = true;
74 74
             }
75 75
         }
76 76
         return $expired;
77 77
     }
78 78
     
79
-    public function productName(){
79
+    public function productName() {
80 80
         $name = "";
81 81
         $product = $this->getProduct();
82
-        if($product){
82
+        if ($product) {
83 83
             $name = $product->name;
84 84
         }
85 85
         return $name;
86 86
     }
87 87
     
88
-    public function isDownloadable(){
88
+    public function isDownloadable() {
89 89
         $check = false;
90 90
         $product = $this->getProduct();
91
-        if($product){
91
+        if ($product) {
92 92
             $type = $product->type;
93
-            if($type){
93
+            if ($type) {
94 94
                 $type_name = $type->name;
95
-                if($type_name=='download'){
95
+                if ($type_name == 'download') {
96 96
                     $check = true;
97 97
                 }
98 98
             }
Please login to merge, or discard this patch.
database/seeds/CompanyType.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,8 +14,8 @@
 block discarded – undo
14 14
         \DB::statement('SET FOREIGN_KEY_CHECKS=0;');
15 15
         \DB::table('company_types')->truncate();
16 16
         \DB::statement('SET FOREIGN_KEY_CHECKS=1;');
17
-        $types = ['Public Company','Self Employed','Non Profit','Privately Held','Partnership'];
18
-        foreach($types as $type){
17
+        $types = ['Public Company', 'Self Employed', 'Non Profit', 'Privately Held', 'Partnership'];
18
+        foreach ($types as $type) {
19 19
             \DB::table('company_types')->insert([
20 20
                 'short'=>  str_slug($type),
21 21
                 'name'=>$type
Please login to merge, or discard this patch.
database/seeds/DatabaseSeeder.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@
 block discarded – undo
146 146
         \DB::table('products')->truncate();
147 147
         \DB::statement('SET FOREIGN_KEY_CHECKS=1;');
148 148
         Product::create(['id' => 1, 'name' => 'default', 'type' => 1, 'group' => 1]);
149
-         //Product::create(['id'=>2,'name'=>'none1','type'=>1,'group' =>1]);
149
+            //Product::create(['id'=>2,'name'=>'none1','type'=>1,'group' =>1]);
150 150
     }
151 151
 }
152 152
 
Please login to merge, or discard this patch.
database/seeds/CompanySize.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,8 +14,8 @@
 block discarded – undo
14 14
         \DB::statement('SET FOREIGN_KEY_CHECKS=0;');
15 15
         \DB::table('company_sizes')->truncate();
16 16
         \DB::statement('SET FOREIGN_KEY_CHECKS=1;');
17
-        $sizes = ['myself only','2-10','11-50','51-200','201-500','501-1000','1001-5000','5001-10000','10001+'];
18
-        foreach($sizes as $size){
17
+        $sizes = ['myself only', '2-10', '11-50', '51-200', '201-500', '501-1000', '1001-5000', '5001-10000', '10001+'];
18
+        foreach ($sizes as $size) {
19 19
             \DB::table('company_sizes')->insert([
20 20
                 'short'=>  str_slug($size),
21 21
                 'name'=>$size
Please login to merge, or discard this patch.
database/migrations/2017_06_10_062630_create_templates_table.php 1 patch
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -5,33 +5,33 @@
 block discarded – undo
5 5
 
6 6
 class CreateTemplatesTable extends Migration {
7 7
 
8
-	/**
9
-	 * Run the migrations.
10
-	 *
11
-	 * @return void
12
-	 */
13
-	public function up()
14
-	{
15
-		Schema::create('templates', function(Blueprint $table)
16
-		{
17
-			$table->increments('id');
18
-			$table->string('name');
19
-			$table->integer('type')->unsigned()->index('templates_type_foreign');
20
-			$table->string('url');
21
-			$table->text('data', 16777215);
22
-			$table->timestamps();
23
-		});
24
-	}
8
+    /**
9
+     * Run the migrations.
10
+     *
11
+     * @return void
12
+     */
13
+    public function up()
14
+    {
15
+        Schema::create('templates', function(Blueprint $table)
16
+        {
17
+            $table->increments('id');
18
+            $table->string('name');
19
+            $table->integer('type')->unsigned()->index('templates_type_foreign');
20
+            $table->string('url');
21
+            $table->text('data', 16777215);
22
+            $table->timestamps();
23
+        });
24
+    }
25 25
 
26 26
 
27
-	/**
28
-	 * Reverse the migrations.
29
-	 *
30
-	 * @return void
31
-	 */
32
-	public function down()
33
-	{
34
-		Schema::drop('templates');
35
-	}
27
+    /**
28
+     * Reverse the migrations.
29
+     *
30
+     * @return void
31
+     */
32
+    public function down()
33
+    {
34
+        Schema::drop('templates');
35
+    }
36 36
 
37 37
 }
Please login to merge, or discard this patch.
database/migrations/2017_06_10_062630_create_invoice_items_table.php 1 patch
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -5,41 +5,41 @@
 block discarded – undo
5 5
 
6 6
 class CreateInvoiceItemsTable extends Migration {
7 7
 
8
-	/**
9
-	 * Run the migrations.
10
-	 *
11
-	 * @return void
12
-	 */
13
-	public function up()
14
-	{
15
-		Schema::create('invoice_items', function(Blueprint $table)
16
-		{
17
-			$table->increments('id');
18
-			$table->integer('invoice_id')->unsigned()->index('invoice_items_invoice_id_foreign');
19
-			$table->string('product_name');
20
-			$table->string('regular_price');
21
-			$table->string('quantity');
22
-			$table->string('discount');
23
-			$table->string('tax_name');
24
-			$table->string('tax_percentage');
25
-			$table->string('tax_code');
26
-			$table->string('discount_mode');
27
-			$table->string('subtotal', 225);
28
-			$table->string('domain', 225);
29
-			$table->integer('plan_id');
30
-			$table->timestamps();
31
-		});
32
-	}
8
+    /**
9
+     * Run the migrations.
10
+     *
11
+     * @return void
12
+     */
13
+    public function up()
14
+    {
15
+        Schema::create('invoice_items', function(Blueprint $table)
16
+        {
17
+            $table->increments('id');
18
+            $table->integer('invoice_id')->unsigned()->index('invoice_items_invoice_id_foreign');
19
+            $table->string('product_name');
20
+            $table->string('regular_price');
21
+            $table->string('quantity');
22
+            $table->string('discount');
23
+            $table->string('tax_name');
24
+            $table->string('tax_percentage');
25
+            $table->string('tax_code');
26
+            $table->string('discount_mode');
27
+            $table->string('subtotal', 225);
28
+            $table->string('domain', 225);
29
+            $table->integer('plan_id');
30
+            $table->timestamps();
31
+        });
32
+    }
33 33
 
34 34
 
35
-	/**
36
-	 * Reverse the migrations.
37
-	 *
38
-	 * @return void
39
-	 */
40
-	public function down()
41
-	{
42
-		Schema::drop('invoice_items');
43
-	}
35
+    /**
36
+     * Reverse the migrations.
37
+     *
38
+     * @return void
39
+     */
40
+    public function down()
41
+    {
42
+        Schema::drop('invoice_items');
43
+    }
44 44
 
45 45
 }
Please login to merge, or discard this patch.
database/migrations/2017_06_10_062630_create_frontend_pages_table.php 1 patch
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -5,37 +5,37 @@
 block discarded – undo
5 5
 
6 6
 class CreateFrontendPagesTable extends Migration {
7 7
 
8
-	/**
9
-	 * Run the migrations.
10
-	 *
11
-	 * @return void
12
-	 */
13
-	public function up()
14
-	{
15
-		Schema::create('frontend_pages', function(Blueprint $table)
16
-		{
17
-			$table->increments('id');
18
-			$table->integer('parent_page_id');
19
-			$table->string('slug');
20
-			$table->string('name');
21
-			$table->text('content', 65535);
22
-			$table->string('url');
23
-			$table->string('type', 225);
24
-			$table->integer('publish');
25
-			$table->integer('hidden');
26
-			$table->timestamps();
27
-		});
28
-	}
8
+    /**
9
+     * Run the migrations.
10
+     *
11
+     * @return void
12
+     */
13
+    public function up()
14
+    {
15
+        Schema::create('frontend_pages', function(Blueprint $table)
16
+        {
17
+            $table->increments('id');
18
+            $table->integer('parent_page_id');
19
+            $table->string('slug');
20
+            $table->string('name');
21
+            $table->text('content', 65535);
22
+            $table->string('url');
23
+            $table->string('type', 225);
24
+            $table->integer('publish');
25
+            $table->integer('hidden');
26
+            $table->timestamps();
27
+        });
28
+    }
29 29
 
30 30
 
31
-	/**
32
-	 * Reverse the migrations.
33
-	 *
34
-	 * @return void
35
-	 */
36
-	public function down()
37
-	{
38
-		Schema::drop('frontend_pages');
39
-	}
31
+    /**
32
+     * Reverse the migrations.
33
+     *
34
+     * @return void
35
+     */
36
+    public function down()
37
+    {
38
+        Schema::drop('frontend_pages');
39
+    }
40 40
 
41 41
 }
Please login to merge, or discard this patch.
migrations/2017_06_10_062632_add_foreign_keys_to_templates_table.php 1 patch
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -5,31 +5,31 @@
 block discarded – undo
5 5
 
6 6
 class AddForeignKeysToTemplatesTable extends Migration {
7 7
 
8
-	/**
9
-	 * Run the migrations.
10
-	 *
11
-	 * @return void
12
-	 */
13
-	public function up()
14
-	{
15
-		Schema::table('templates', function(Blueprint $table)
16
-		{
17
-			$table->foreign('type')->references('id')->on('template_types')->onUpdate('RESTRICT')->onDelete('RESTRICT');
18
-		});
19
-	}
8
+    /**
9
+     * Run the migrations.
10
+     *
11
+     * @return void
12
+     */
13
+    public function up()
14
+    {
15
+        Schema::table('templates', function(Blueprint $table)
16
+        {
17
+            $table->foreign('type')->references('id')->on('template_types')->onUpdate('RESTRICT')->onDelete('RESTRICT');
18
+        });
19
+    }
20 20
 
21 21
 
22
-	/**
23
-	 * Reverse the migrations.
24
-	 *
25
-	 * @return void
26
-	 */
27
-	public function down()
28
-	{
29
-		Schema::table('templates', function(Blueprint $table)
30
-		{
31
-			$table->dropForeign('templates_type_foreign');
32
-		});
33
-	}
22
+    /**
23
+     * Reverse the migrations.
24
+     *
25
+     * @return void
26
+     */
27
+    public function down()
28
+    {
29
+        Schema::table('templates', function(Blueprint $table)
30
+        {
31
+            $table->dropForeign('templates_type_foreign');
32
+        });
33
+    }
34 34
 
35 35
 }
Please login to merge, or discard this patch.