@@ -39,6 +39,6 @@ |
||
| 39 | 39 | */ |
| 40 | 40 | public function handle() |
| 41 | 41 | { |
| 42 | - Subscription::where('end_date','<',Carbon::today())->where('status','=',\constSubscription::onGoing)->update(['status' => \constSubscription::Expired]); |
|
| 42 | + Subscription::where('end_date', '<', Carbon::today())->where('status', '=', \constSubscription::onGoing)->update(['status' => \constSubscription::Expired]); |
|
| 43 | 43 | } |
| 44 | 44 | } |
@@ -33,36 +33,36 @@ |
||
| 33 | 33 | |
| 34 | 34 | public function getPlanDisplayAttribute() |
| 35 | 35 | { |
| 36 | - return $this->plan_code . ' @ ' . $this->amount .' For '. $this->days .' Days'; |
|
| 36 | + return $this->plan_code.' @ '.$this->amount.' For '.$this->days.' Days'; |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | public function scopeExcludeArchive($query) |
| 40 | 40 | { |
| 41 | - return $query->where('status','!=', \constStatus::Archive); |
|
| 41 | + return $query->where('status', '!=', \constStatus::Archive); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | public function scopeOnlyActive($query) |
| 45 | 45 | { |
| 46 | - return $query->where('status','=', \constStatus::Active); |
|
| 46 | + return $query->where('status', '=', \constStatus::Active); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | public function createdBy() |
| 50 | 50 | { |
| 51 | - return $this->belongsTo('App\User','created_by'); |
|
| 51 | + return $this->belongsTo('App\User', 'created_by'); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | public function updatedBy() |
| 55 | 55 | { |
| 56 | - return $this->belongsTo('App\User','updated_by'); |
|
| 56 | + return $this->belongsTo('App\User', 'updated_by'); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | public function Subscriptions() |
| 60 | 60 | { |
| 61 | - return $this->hasMany('App\Subscription','plan_id'); |
|
| 61 | + return $this->hasMany('App\Subscription', 'plan_id'); |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | public function Service() |
| 65 | 65 | { |
| 66 | - return $this->belongsTo('App\Service','service_id'); |
|
| 66 | + return $this->belongsTo('App\Service', 'service_id'); |
|
| 67 | 67 | } |
| 68 | 68 | } |
@@ -27,43 +27,43 @@ |
||
| 27 | 27 | 'Invoice.member.name' => 20, |
| 28 | 28 | ]; |
| 29 | 29 | |
| 30 | - public function scopeIndexQuery($query,$sorting_field,$sorting_direction,$drp_start,$drp_end) |
|
| 30 | + public function scopeIndexQuery($query, $sorting_field, $sorting_direction, $drp_start, $drp_end) |
|
| 31 | 31 | { |
| 32 | 32 | $sorting_field = ($sorting_field != null ? $sorting_field : 'created_at'); |
| 33 | 33 | $sorting_direction = ($sorting_direction != null ? $sorting_direction : 'desc'); |
| 34 | 34 | |
| 35 | 35 | if ($drp_start == null or $drp_end == null) |
| 36 | 36 | { |
| 37 | - return $query->leftJoin('trn_invoice','trn_payment_details.invoice_id','=','trn_invoice.id') |
|
| 38 | - ->leftJoin('mst_members','trn_invoice.member_id','=','mst_members.id') |
|
| 39 | - ->select('trn_payment_details.id','trn_payment_details.created_at','trn_payment_details.payment_amount','trn_payment_details.mode','trn_payment_details.invoice_id','trn_invoice.invoice_number','mst_members.id as member_id','mst_members.name as member_name','mst_members.member_code') |
|
| 40 | - ->orderBy($sorting_field,$sorting_direction); |
|
| 37 | + return $query->leftJoin('trn_invoice', 'trn_payment_details.invoice_id', '=', 'trn_invoice.id') |
|
| 38 | + ->leftJoin('mst_members', 'trn_invoice.member_id', '=', 'mst_members.id') |
|
| 39 | + ->select('trn_payment_details.id', 'trn_payment_details.created_at', 'trn_payment_details.payment_amount', 'trn_payment_details.mode', 'trn_payment_details.invoice_id', 'trn_invoice.invoice_number', 'mst_members.id as member_id', 'mst_members.name as member_name', 'mst_members.member_code') |
|
| 40 | + ->orderBy($sorting_field, $sorting_direction); |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | - return $query->leftJoin('trn_invoice','trn_payment_details.invoice_id','=','trn_invoice.id') |
|
| 44 | - ->leftJoin('mst_members','trn_invoice.member_id','=','mst_members.id') |
|
| 45 | - ->select('trn_payment_details.id','trn_payment_details.created_at','trn_payment_details.payment_amount','trn_payment_details.mode','trn_invoice.invoice_number','mst_members.name as member_name','mst_members.member_code') |
|
| 43 | + return $query->leftJoin('trn_invoice', 'trn_payment_details.invoice_id', '=', 'trn_invoice.id') |
|
| 44 | + ->leftJoin('mst_members', 'trn_invoice.member_id', '=', 'mst_members.id') |
|
| 45 | + ->select('trn_payment_details.id', 'trn_payment_details.created_at', 'trn_payment_details.payment_amount', 'trn_payment_details.mode', 'trn_invoice.invoice_number', 'mst_members.name as member_name', 'mst_members.member_code') |
|
| 46 | 46 | ->whereBetween('trn_payment_details.created_at', [$drp_start, $drp_end]) |
| 47 | - ->orderBy($sorting_field,$sorting_direction); |
|
| 47 | + ->orderBy($sorting_field, $sorting_direction); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | public function createdBy() |
| 51 | 51 | { |
| 52 | - return $this->belongsTo('App\User','created_by'); |
|
| 52 | + return $this->belongsTo('App\User', 'created_by'); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | public function updatedBy() |
| 56 | 56 | { |
| 57 | - return $this->belongsTo('App\User','updated_by'); |
|
| 57 | + return $this->belongsTo('App\User', 'updated_by'); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | public function Invoice() |
| 61 | 61 | { |
| 62 | - return $this->belongsTo('App\Invoice','invoice_id'); |
|
| 62 | + return $this->belongsTo('App\Invoice', 'invoice_id'); |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | public function Cheque() |
| 66 | 66 | { |
| 67 | - return $this->hasOne('App\Cheque_detail','payment_id'); |
|
| 67 | + return $this->hasOne('App\Cheque_detail', 'payment_id'); |
|
| 68 | 68 | } |
| 69 | 69 | } |
| 70 | 70 | \ No newline at end of file |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | 'updated_by', |
| 23 | 23 | ]; |
| 24 | 24 | |
| 25 | - protected $dates = ['created_at', 'updated_at', 'start_date', 'end_date']; |
|
| 25 | + protected $dates = ['created_at', 'updated_at', 'start_date', 'end_date']; |
|
| 26 | 26 | |
| 27 | 27 | //Eloquence Search mapping |
| 28 | 28 | use Eloquence; |
@@ -38,75 +38,75 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | public function scopeDashboardExpiring($query) |
| 40 | 40 | { |
| 41 | - return $query->where('end_date','<',Carbon::today()->addDays(7))->where('status','=',\constSubscription::onGoing); |
|
| 41 | + return $query->where('end_date', '<', Carbon::today()->addDays(7))->where('status', '=', \constSubscription::onGoing); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | public function scopeDashboardExpired($query) |
| 45 | 45 | { |
| 46 | - return $query->where('status','=',\constSubscription::Expired); |
|
| 46 | + return $query->where('status', '=', \constSubscription::Expired); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | - public function scopeIndexQuery($query,$sorting_field,$sorting_direction,$drp_start,$drp_end) |
|
| 49 | + public function scopeIndexQuery($query, $sorting_field, $sorting_direction, $drp_start, $drp_end) |
|
| 50 | 50 | { |
| 51 | 51 | $sorting_field = ($sorting_field != null ? $sorting_field : 'created_at'); |
| 52 | 52 | $sorting_direction = ($sorting_direction != null ? $sorting_direction : 'desc'); |
| 53 | 53 | |
| 54 | 54 | if ($drp_start == null or $drp_end == null) |
| 55 | 55 | { |
| 56 | - return $query->leftJoin('mst_plans', 'trn_subscriptions.plan_id', '=', 'mst_plans.id')->select('trn_subscriptions.*','mst_plans.plan_name')->orderBy($sorting_field,$sorting_direction); |
|
| 56 | + return $query->leftJoin('mst_plans', 'trn_subscriptions.plan_id', '=', 'mst_plans.id')->select('trn_subscriptions.*', 'mst_plans.plan_name')->orderBy($sorting_field, $sorting_direction); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - return $query->leftJoin('mst_plans', 'trn_subscriptions.plan_id', '=', 'mst_plans.id')->select('trn_subscriptions.*','mst_plans.plan_name')->whereBetween('trn_subscriptions.created_at', [$drp_start, $drp_end])->orderBy($sorting_field,$sorting_direction); |
|
| 59 | + return $query->leftJoin('mst_plans', 'trn_subscriptions.plan_id', '=', 'mst_plans.id')->select('trn_subscriptions.*', 'mst_plans.plan_name')->whereBetween('trn_subscriptions.created_at', [$drp_start, $drp_end])->orderBy($sorting_field, $sorting_direction); |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | - public function scopeExpiring($query,$sorting_field,$sorting_direction,$drp_start,$drp_end) |
|
| 62 | + public function scopeExpiring($query, $sorting_field, $sorting_direction, $drp_start, $drp_end) |
|
| 63 | 63 | { |
| 64 | 64 | $sorting_field = ($sorting_field != null ? $sorting_field : 'created_at'); |
| 65 | 65 | $sorting_direction = ($sorting_direction != null ? $sorting_direction : 'desc'); |
| 66 | 66 | |
| 67 | 67 | if ($drp_start == null or $drp_end == null) |
| 68 | 68 | { |
| 69 | - return $query->leftJoin('mst_plans', 'trn_subscriptions.plan_id', '=', 'mst_plans.id')->select('trn_subscriptions.*','mst_plans.plan_name')->where('trn_subscriptions.end_date','<',Carbon::today()->addDays(7))->where('trn_subscriptions.status','=',\constSubscription::onGoing)->orderBy($sorting_field,$sorting_direction); |
|
| 69 | + return $query->leftJoin('mst_plans', 'trn_subscriptions.plan_id', '=', 'mst_plans.id')->select('trn_subscriptions.*', 'mst_plans.plan_name')->where('trn_subscriptions.end_date', '<', Carbon::today()->addDays(7))->where('trn_subscriptions.status', '=', \constSubscription::onGoing)->orderBy($sorting_field, $sorting_direction); |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | - return $query->leftJoin('mst_plans', 'trn_subscriptions.plan_id', '=', 'mst_plans.id')->select('trn_subscriptions.*','mst_plans.plan_name')->where('trn_subscriptions.end_date','<',Carbon::today()->addDays(7))->where('trn_subscriptions.status','=',\constSubscription::onGoing)->whereBetween('trn_subscriptions.created_at', [$drp_start, $drp_end])->orderBy($sorting_field,$sorting_direction); |
|
| 72 | + return $query->leftJoin('mst_plans', 'trn_subscriptions.plan_id', '=', 'mst_plans.id')->select('trn_subscriptions.*', 'mst_plans.plan_name')->where('trn_subscriptions.end_date', '<', Carbon::today()->addDays(7))->where('trn_subscriptions.status', '=', \constSubscription::onGoing)->whereBetween('trn_subscriptions.created_at', [$drp_start, $drp_end])->orderBy($sorting_field, $sorting_direction); |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - public function scopeExpired($query,$sorting_field,$sorting_direction,$drp_start,$drp_end) |
|
| 75 | + public function scopeExpired($query, $sorting_field, $sorting_direction, $drp_start, $drp_end) |
|
| 76 | 76 | { |
| 77 | 77 | $sorting_field = ($sorting_field != null ? $sorting_field : 'created_at'); |
| 78 | 78 | $sorting_direction = ($sorting_direction != null ? $sorting_direction : 'desc'); |
| 79 | 79 | |
| 80 | 80 | if ($drp_start == null or $drp_end == null) |
| 81 | 81 | { |
| 82 | - return $query->leftJoin('mst_plans', 'trn_subscriptions.plan_id', '=', 'mst_plans.id')->select('trn_subscriptions.*','mst_plans.plan_name')->where('trn_subscriptions.status','=',\constSubscription::Expired)->where('trn_subscriptions.status','!=',\constSubscription::renewed)->orderBy($sorting_field,$sorting_direction); |
|
| 82 | + return $query->leftJoin('mst_plans', 'trn_subscriptions.plan_id', '=', 'mst_plans.id')->select('trn_subscriptions.*', 'mst_plans.plan_name')->where('trn_subscriptions.status', '=', \constSubscription::Expired)->where('trn_subscriptions.status', '!=', \constSubscription::renewed)->orderBy($sorting_field, $sorting_direction); |
|
| 83 | 83 | } |
| 84 | 84 | |
| 85 | - return $query->leftJoin('mst_plans', 'trn_subscriptions.plan_id', '=', 'mst_plans.id')->select('trn_subscriptions.*','mst_plans.plan_name')->where('trn_subscriptions.status','=',\constSubscription::Expired)->where('trn_subscriptions.status','!=',\constSubscription::renewed)->whereBetween('trn_subscriptions.created_at', [$drp_start, $drp_end])->orderBy($sorting_field,$sorting_direction); |
|
| 85 | + return $query->leftJoin('mst_plans', 'trn_subscriptions.plan_id', '=', 'mst_plans.id')->select('trn_subscriptions.*', 'mst_plans.plan_name')->where('trn_subscriptions.status', '=', \constSubscription::Expired)->where('trn_subscriptions.status', '!=', \constSubscription::renewed)->whereBetween('trn_subscriptions.created_at', [$drp_start, $drp_end])->orderBy($sorting_field, $sorting_direction); |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | public function createdBy() |
| 89 | 89 | { |
| 90 | - return $this->belongsTo('App\User','created_by'); |
|
| 90 | + return $this->belongsTo('App\User', 'created_by'); |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | public function updatedBy() |
| 94 | 94 | { |
| 95 | - return $this->belongsTo('App\User','updated_by'); |
|
| 95 | + return $this->belongsTo('App\User', 'updated_by'); |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | public function Member() |
| 99 | 99 | { |
| 100 | - return $this->belongsTo('App\Member','member_id'); |
|
| 100 | + return $this->belongsTo('App\Member', 'member_id'); |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | public function Plan() |
| 104 | 104 | { |
| 105 | - return $this->belongsTo('App\Plan','plan_id'); |
|
| 105 | + return $this->belongsTo('App\Plan', 'plan_id'); |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | public function Invoice() |
| 109 | 109 | { |
| 110 | - return $this->belongsTo('App\Invoice','invoice_id'); |
|
| 110 | + return $this->belongsTo('App\Invoice', 'invoice_id'); |
|
| 111 | 111 | } |
| 112 | 112 | } |
@@ -43,30 +43,30 @@ |
||
| 43 | 43 | |
| 44 | 44 | public function createdBy() |
| 45 | 45 | { |
| 46 | - return $this->belongsTo('App\User','created_by'); |
|
| 46 | + return $this->belongsTo('App\User', 'created_by'); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | public function updatedBy() |
| 50 | 50 | { |
| 51 | - return $this->belongsTo('App\User','updated_by'); |
|
| 51 | + return $this->belongsTo('App\User', 'updated_by'); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - public function scopeIndexQuery($query,$sorting_field,$sorting_direction,$drp_start,$drp_end) |
|
| 54 | + public function scopeIndexQuery($query, $sorting_field, $sorting_direction, $drp_start, $drp_end) |
|
| 55 | 55 | { |
| 56 | 56 | $sorting_field = ($sorting_field != null ? $sorting_field : 'created_at'); |
| 57 | 57 | $sorting_direction = ($sorting_direction != null ? $sorting_direction : 'desc'); |
| 58 | 58 | |
| 59 | 59 | if ($drp_start == null or $drp_end == null) |
| 60 | 60 | { |
| 61 | - return $query->select('id','name','contact','email','address','gender','created_at','status')->orderBy($sorting_field,$sorting_direction); |
|
| 61 | + return $query->select('id', 'name', 'contact', 'email', 'address', 'gender', 'created_at', 'status')->orderBy($sorting_field, $sorting_direction); |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - return $query->select('id','name','contact','email','address','gender','created_at','status')->whereBetween('created_at', [$drp_start, $drp_end])->orderBy($sorting_field,$sorting_direction); |
|
| 64 | + return $query->select('id', 'name', 'contact', 'email', 'address', 'gender', 'created_at', 'status')->whereBetween('created_at', [$drp_start, $drp_end])->orderBy($sorting_field, $sorting_direction); |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | public function scopeOnlyLeads($query) |
| 68 | 68 | { |
| 69 | - return $query->where('status','=', \constEnquiryStatus::Lead)->orderBy('created_at','desc')->take(10); |
|
| 69 | + return $query->where('status', '=', \constEnquiryStatus::Lead)->orderBy('created_at', 'desc')->take(10); |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | } |
| 73 | 73 | \ No newline at end of file |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | 'updated_by' |
| 21 | 21 | ]; |
| 22 | 22 | |
| 23 | - protected $dates = ['created_at', 'updated_at', 'date']; |
|
| 23 | + protected $dates = ['created_at', 'updated_at', 'date']; |
|
| 24 | 24 | |
| 25 | 25 | //Eloquence Search mapping |
| 26 | 26 | use Eloquence; |
@@ -33,11 +33,11 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | public function createdBy() |
| 35 | 35 | { |
| 36 | - return $this->belongsTo('App\User','created_by'); |
|
| 36 | + return $this->belongsTo('App\User', 'created_by'); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | public function updatedBy() |
| 40 | 40 | { |
| 41 | - return $this->belongsTo('App\User','updated_by'); |
|
| 41 | + return $this->belongsTo('App\User', 'updated_by'); |
|
| 42 | 42 | } |
| 43 | 43 | } |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | */ |
| 38 | 38 | public function map(Router $router) |
| 39 | 39 | { |
| 40 | - $router->group(['namespace' => $this->namespace], function ($router) { |
|
| 40 | + $router->group(['namespace' => $this->namespace], function($router) { |
|
| 41 | 41 | require app_path('Http/routes.php'); |
| 42 | 42 | }); |
| 43 | 43 | } |
@@ -19,21 +19,21 @@ |
||
| 19 | 19 | |
| 20 | 20 | public function scopeExcludeArchive($query) |
| 21 | 21 | { |
| 22 | - return $query->where('status','!=', \constStatus::Archive); |
|
| 22 | + return $query->where('status', '!=', \constStatus::Archive); |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | public function Expenses() |
| 26 | 26 | { |
| 27 | - return $this->hasMany('App\Expense','category_id'); |
|
| 27 | + return $this->hasMany('App\Expense', 'category_id'); |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | public function createdBy() |
| 31 | 31 | { |
| 32 | - return $this->belongsTo('app\User','created_by'); |
|
| 32 | + return $this->belongsTo('app\User', 'created_by'); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | public function updatedBy() |
| 36 | 36 | { |
| 37 | - return $this->belongsTo('app\User','updated_by'); |
|
| 37 | + return $this->belongsTo('app\User', 'updated_by'); |
|
| 38 | 38 | } |
| 39 | 39 | } |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | * @return mixed |
| 15 | 15 | */ |
| 16 | 16 | |
| 17 | - public function handle($request, Closure $next,$permissions) |
|
| 17 | + public function handle($request, Closure $next, $permissions) |
|
| 18 | 18 | { |
| 19 | 19 | if (!Auth::User()->can($permissions)) |
| 20 | 20 | { |