@@ -27,16 +27,16 @@ |
||
27 | 27 | |
28 | 28 | public function createdBy() |
29 | 29 | { |
30 | - return $this->belongsTo('App\User','created_by'); |
|
30 | + return $this->belongsTo('App\User', 'created_by'); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | public function updatedBy() |
34 | 34 | { |
35 | - return $this->belongsTo('App\User','updated_by'); |
|
35 | + return $this->belongsTo('App\User', 'updated_by'); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | public function Plans() |
39 | 39 | { |
40 | - return $this->hasMany('App\Plan','service_id'); |
|
40 | + return $this->hasMany('App\Plan', 'service_id'); |
|
41 | 41 | } |
42 | 42 | } |
@@ -27,11 +27,11 @@ |
||
27 | 27 | |
28 | 28 | public function createdBy() |
29 | 29 | { |
30 | - return $this->belongsTo('App\User','created_by'); |
|
30 | + return $this->belongsTo('App\User', 'created_by'); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | public function updatedBy() |
34 | 34 | { |
35 | - return $this->belongsTo('App\User','updated_by'); |
|
35 | + return $this->belongsTo('App\User', 'updated_by'); |
|
36 | 36 | } |
37 | 37 | } |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | |
21 | 21 | public $timestamps = false; |
22 | 22 | |
23 | - protected $dates = ['send_time']; |
|
23 | + protected $dates = ['send_time']; |
|
24 | 24 | |
25 | 25 | //Eloquence Search mapping |
26 | 26 | use Eloquence; |
@@ -33,6 +33,6 @@ discard block |
||
33 | 33 | |
34 | 34 | public function scopeDashboardLogs($query) |
35 | 35 | { |
36 | - return $query->where('send_time','<=',Carbon::now())->take(5)->orderBy('send_time','desc'); |
|
36 | + return $query->where('send_time', '<=', Carbon::now())->take(5)->orderBy('send_time', 'desc'); |
|
37 | 37 | } |
38 | 38 | } |
@@ -20,29 +20,29 @@ |
||
20 | 20 | 'updated_by', |
21 | 21 | ]; |
22 | 22 | |
23 | - protected $dates = ['created_at', 'updated_at', 'due_date']; |
|
23 | + protected $dates = ['created_at', 'updated_at', 'due_date']; |
|
24 | 24 | |
25 | 25 | public function Enquiry() |
26 | 26 | { |
27 | - return $this->belongsTo('App\Enquiry','enquiry_id'); |
|
27 | + return $this->belongsTo('App\Enquiry', 'enquiry_id'); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | public function scopeReminders($query) |
31 | 31 | { |
32 | - return $query->leftJoin('mst_enquiries','trn_enquiry_followups.enquiry_id','=','mst_enquiries.id') |
|
33 | - ->select('trn_enquiry_followups.*','mst_enquiries.status') |
|
34 | - ->where('trn_enquiry_followups.due_date','<=',Carbon::today()) |
|
35 | - ->where('trn_enquiry_followups.status','=',\constFollowUpStatus::Pending) |
|
36 | - ->where('mst_enquiries.status','=',\constEnquiryStatus::Lead); |
|
32 | + return $query->leftJoin('mst_enquiries', 'trn_enquiry_followups.enquiry_id', '=', 'mst_enquiries.id') |
|
33 | + ->select('trn_enquiry_followups.*', 'mst_enquiries.status') |
|
34 | + ->where('trn_enquiry_followups.due_date', '<=', Carbon::today()) |
|
35 | + ->where('trn_enquiry_followups.status', '=', \constFollowUpStatus::Pending) |
|
36 | + ->where('mst_enquiries.status', '=', \constEnquiryStatus::Lead); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | public function createdBy() |
40 | 40 | { |
41 | - return $this->belongsTo('App\User','created_by'); |
|
41 | + return $this->belongsTo('App\User', 'created_by'); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | public function updatedBy() |
45 | 45 | { |
46 | - return $this->belongsTo('App\User','updated_by'); |
|
46 | + return $this->belongsTo('App\User', 'updated_by'); |
|
47 | 47 | } |
48 | 48 | } |
49 | 49 | \ No newline at end of file |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | class Member extends Model implements HasMediaConversions |
13 | 13 | { |
14 | - use HasMediaTrait , Eloquence; |
|
14 | + use HasMediaTrait, Eloquence; |
|
15 | 15 | |
16 | 16 | protected $table = 'mst_members'; |
17 | 17 | |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | 'updated_by' |
36 | 36 | ]; |
37 | 37 | |
38 | - protected $dates = ['created_at', 'updated_at', 'DOB']; |
|
38 | + protected $dates = ['created_at', 'updated_at', 'DOB']; |
|
39 | 39 | |
40 | 40 | |
41 | 41 | protected $searchableColumns = [ |
@@ -54,18 +54,18 @@ discard block |
||
54 | 54 | |
55 | 55 | $this->addMediaConversion('form') |
56 | 56 | ->setManipulations(['w' => 70, 'h' => 70, 'q' => 100, 'fit' => 'crop']) |
57 | - ->performOnCollections('profile','proof'); |
|
57 | + ->performOnCollections('profile', 'proof'); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | //Relationships |
61 | 61 | public function createdBy() |
62 | 62 | { |
63 | - return $this->belongsTo('App\User','created_by'); |
|
63 | + return $this->belongsTo('App\User', 'created_by'); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | public function updatedBy() |
67 | 67 | { |
68 | - return $this->belongsTo('App\User','updated_by'); |
|
68 | + return $this->belongsTo('App\User', 'updated_by'); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | public function Subscriptions() |
@@ -79,17 +79,17 @@ discard block |
||
79 | 79 | } |
80 | 80 | |
81 | 81 | //Scope Queries |
82 | - public function scopeIndexQuery($query,$sorting_field,$sorting_direction,$drp_start,$drp_end) |
|
82 | + public function scopeIndexQuery($query, $sorting_field, $sorting_direction, $drp_start, $drp_end) |
|
83 | 83 | { |
84 | 84 | $sorting_field = ($sorting_field != null ? $sorting_field : 'created_at'); |
85 | 85 | $sorting_direction = ($sorting_direction != null ? $sorting_direction : 'desc'); |
86 | 86 | |
87 | 87 | if ($drp_start == null or $drp_end == null) |
88 | 88 | { |
89 | - return $query->select('mst_members.id','mst_members.member_code','mst_members.name','mst_members.contact','mst_members.created_at','mst_members.status')->where('mst_members.status','!=', \constStatus::Archive)->orderBy($sorting_field,$sorting_direction); |
|
89 | + return $query->select('mst_members.id', 'mst_members.member_code', 'mst_members.name', 'mst_members.contact', 'mst_members.created_at', 'mst_members.status')->where('mst_members.status', '!=', \constStatus::Archive)->orderBy($sorting_field, $sorting_direction); |
|
90 | 90 | } |
91 | 91 | |
92 | - return $query->select('mst_members.id','mst_members.member_code','mst_members.name','mst_members.contact','mst_members.created_at','mst_members.status')->where('mst_members.status','!=', \constStatus::Archive)->whereBetween('mst_members.created_at', [$drp_start, $drp_end])->orderBy($sorting_field,$sorting_direction); |
|
92 | + return $query->select('mst_members.id', 'mst_members.member_code', 'mst_members.name', 'mst_members.contact', 'mst_members.created_at', 'mst_members.status')->where('mst_members.status', '!=', \constStatus::Archive)->whereBetween('mst_members.created_at', [$drp_start, $drp_end])->orderBy($sorting_field, $sorting_direction); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | |
@@ -108,28 +108,28 @@ discard block |
||
108 | 108 | |
109 | 109 | public function scopeActive($query) |
110 | 110 | { |
111 | - return $query->where('status','=', \constStatus::Active); |
|
111 | + return $query->where('status', '=', \constStatus::Active); |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | public function scopeInactive($query) |
115 | 115 | { |
116 | - return $query->where('status','=', \constStatus::InActive); |
|
116 | + return $query->where('status', '=', \constStatus::InActive); |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | public function scopeRecent($query) |
120 | 120 | { |
121 | - return $query->where('created_at','<=',Carbon::today())->take(10)->orderBy('created_at','desc'); |
|
121 | + return $query->where('created_at', '<=', Carbon::today())->take(10)->orderBy('created_at', 'desc'); |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | public function scopeBirthday($query) |
125 | 125 | { |
126 | - return $query->whereMonth('DOB','=',Carbon::today()->month)->whereDay('DOB','<',Carbon::today()->addDays(7))->whereDay('DOB','>=',Carbon::today()->day)->where('status','=',\constStatus::Active); |
|
126 | + return $query->whereMonth('DOB', '=', Carbon::today()->month)->whereDay('DOB', '<', Carbon::today()->addDays(7))->whereDay('DOB', '>=', Carbon::today()->day)->where('status', '=', \constStatus::Active); |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | // Laravel issue: Workaroud Needed |
130 | - public function scopeRegistrations($query,$month,$year) |
|
130 | + public function scopeRegistrations($query, $month, $year) |
|
131 | 131 | { |
132 | - return $query->whereMonth('created_at', '=', $month)->whereYear('created_at', '=',$year)->count(); |
|
132 | + return $query->whereMonth('created_at', '=', $month)->whereYear('created_at', '=', $year)->count(); |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | } |
136 | 136 | \ No newline at end of file |
@@ -35,7 +35,7 @@ |
||
35 | 35 | { |
36 | 36 | if (Auth::User()->id != 1) |
37 | 37 | { |
38 | - return $query->where('id','!=',1); |
|
38 | + return $query->where('id', '!=', 1); |
|
39 | 39 | } |
40 | 40 | return $query; |
41 | 41 | } |
@@ -27,16 +27,16 @@ |
||
27 | 27 | |
28 | 28 | public function createdBy() |
29 | 29 | { |
30 | - return $this->belongsTo('App\User','created_by'); |
|
30 | + return $this->belongsTo('App\User', 'created_by'); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | public function updatedBy() |
34 | 34 | { |
35 | - return $this->belongsTo('App\User','updated_by'); |
|
35 | + return $this->belongsTo('App\User', 'updated_by'); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | public function Payment() |
39 | 39 | { |
40 | - return $this->belongsTo('App\Payment_detail','payment_id'); |
|
40 | + return $this->belongsTo('App\Payment_detail', 'payment_id'); |
|
41 | 41 | } |
42 | 42 | } |
43 | 43 | \ No newline at end of file |
@@ -30,34 +30,34 @@ discard block |
||
30 | 30 | 'amount' => 10, |
31 | 31 | ]; |
32 | 32 | |
33 | - protected $dates = ['created_at', 'updated_at', 'due_date']; |
|
33 | + protected $dates = ['created_at', 'updated_at', 'due_date']; |
|
34 | 34 | |
35 | 35 | public function createdBy() |
36 | 36 | { |
37 | - return $this->belongsTo('App\User','created_by'); |
|
37 | + return $this->belongsTo('App\User', 'created_by'); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | public function updatedBy() |
41 | 41 | { |
42 | - return $this->belongsTo('App\User','updated_by'); |
|
42 | + return $this->belongsTo('App\User', 'updated_by'); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | public function Category() |
46 | 46 | { |
47 | - return $this->belongsTo('App\ExpenseCategory','category_id'); |
|
47 | + return $this->belongsTo('App\ExpenseCategory', 'category_id'); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | public function scopeDueAlerts($query) |
51 | 51 | { |
52 | - return $query->where('paid','!=',\constPaymentStatus::Paid)->where('due_date','>=',Carbon::today()); |
|
52 | + return $query->where('paid', '!=', \constPaymentStatus::Paid)->where('due_date', '>=', Carbon::today()); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | public function scopeOutstandingAlerts($query) |
56 | 56 | { |
57 | - return $query->where('paid','!=',\constPaymentStatus::Paid)->where('due_date','<',Carbon::today()); |
|
57 | + return $query->where('paid', '!=', \constPaymentStatus::Paid)->where('due_date', '<', Carbon::today()); |
|
58 | 58 | } |
59 | 59 | |
60 | - public function scopeIndexQuery($query,$category,$sorting_field,$sorting_direction,$drp_start,$drp_end) |
|
60 | + public function scopeIndexQuery($query, $category, $sorting_field, $sorting_direction, $drp_start, $drp_end) |
|
61 | 61 | { |
62 | 62 | $sorting_field = ($sorting_field != null ? $sorting_field : 'created_at'); |
63 | 63 | $sorting_direction = ($sorting_direction != null ? $sorting_direction : 'desc'); |
@@ -66,22 +66,22 @@ discard block |
||
66 | 66 | { |
67 | 67 | if ($category == 0) |
68 | 68 | { |
69 | - return $query->leftJoin('mst_expenses_categories', 'trn_expenses.category_id', '=', 'mst_expenses_categories.id')->select('trn_expenses.*','mst_expenses_categories.name as category_name')->orderBy($sorting_field,$sorting_direction); |
|
69 | + return $query->leftJoin('mst_expenses_categories', 'trn_expenses.category_id', '=', 'mst_expenses_categories.id')->select('trn_expenses.*', 'mst_expenses_categories.name as category_name')->orderBy($sorting_field, $sorting_direction); |
|
70 | 70 | } |
71 | 71 | else |
72 | 72 | { |
73 | - return $query->leftJoin('mst_expenses_categories', 'trn_expenses.category_id', '=', 'mst_expenses_categories.id')->select('trn_expenses.*','mst_expenses_categories.name as category_name')->where('category_id',$category)->orderBy($sorting_field,$sorting_direction); |
|
73 | + return $query->leftJoin('mst_expenses_categories', 'trn_expenses.category_id', '=', 'mst_expenses_categories.id')->select('trn_expenses.*', 'mst_expenses_categories.name as category_name')->where('category_id', $category)->orderBy($sorting_field, $sorting_direction); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | } |
77 | 77 | |
78 | 78 | if ($category == 0) |
79 | 79 | { |
80 | - return $query->leftJoin('mst_expenses_categories', 'trn_expenses.category_id', '=', 'mst_expenses_categories.id')->select('trn_expenses.*','mst_expenses_categories.name as category_name')->whereBetween('trn_expenses.created_at', [$drp_start, $drp_end])->orderBy($sorting_field,$sorting_direction); |
|
80 | + return $query->leftJoin('mst_expenses_categories', 'trn_expenses.category_id', '=', 'mst_expenses_categories.id')->select('trn_expenses.*', 'mst_expenses_categories.name as category_name')->whereBetween('trn_expenses.created_at', [$drp_start, $drp_end])->orderBy($sorting_field, $sorting_direction); |
|
81 | 81 | } |
82 | 82 | else |
83 | 83 | { |
84 | - return $query->leftJoin('mst_expenses_categories', 'trn_expenses.category_id', '=', 'mst_expenses_categories.id')->select('trn_expenses.*','mst_expenses_categories.name as category_name')->where('category_id',$category)->whereBetween('trn_expenses.created_at', [$drp_start, $drp_end])->orderBy($sorting_field,$sorting_direction); |
|
84 | + return $query->leftJoin('mst_expenses_categories', 'trn_expenses.category_id', '=', 'mst_expenses_categories.id')->select('trn_expenses.*', 'mst_expenses_categories.name as category_name')->where('category_id', $category)->whereBetween('trn_expenses.created_at', [$drp_start, $drp_end])->orderBy($sorting_field, $sorting_direction); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | } |
@@ -20,21 +20,21 @@ |
||
20 | 20 | |
21 | 21 | public function createdBy() |
22 | 22 | { |
23 | - return $this->belongsTo('App\User','created_by'); |
|
23 | + return $this->belongsTo('App\User', 'created_by'); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | public function updatedBy() |
27 | 27 | { |
28 | - return $this->belongsTo('App\User','updated_by'); |
|
28 | + return $this->belongsTo('App\User', 'updated_by'); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | public function Invoice() |
32 | 32 | { |
33 | - return $this->belongsTo('App\Invoice','invoice_id'); |
|
33 | + return $this->belongsTo('App\Invoice', 'invoice_id'); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | public function Plan() |
37 | 37 | { |
38 | - return $this->belongsTo('App\Plan','plan_id'); |
|
38 | + return $this->belongsTo('App\Plan', 'plan_id'); |
|
39 | 39 | } |
40 | 40 | } |