@@ -4,11 +4,9 @@ |
||
| 4 | 4 | |
| 5 | 5 | use App\Http\Controllers\Controller; |
| 6 | 6 | use App\Http\Requests\Product\AddonRequest; |
| 7 | -use App\Model\Payment\Plan; |
|
| 8 | 7 | use App\Model\Product\Addon; |
| 9 | 8 | use App\Model\Product\Product; |
| 10 | 9 | use App\Model\Product\ProductAddonRelation; |
| 11 | -use App\Model\Product\Subscription; |
|
| 12 | 10 | use Illuminate\Http\Request; |
| 13 | 11 | |
| 14 | 12 | class AddonController extends Controller |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | /** |
| 84 | 84 | * Store a newly created resource in storage. |
| 85 | 85 | * |
| 86 | - * @return Response |
|
| 86 | + * @return \Illuminate\Http\RedirectResponse |
|
| 87 | 87 | */ |
| 88 | 88 | public function store(ClientRequest $request) |
| 89 | 89 | { |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | * |
| 144 | 144 | * @param int $id |
| 145 | 145 | * |
| 146 | - * @return Response |
|
| 146 | + * @return \Illuminate\Http\RedirectResponse |
|
| 147 | 147 | */ |
| 148 | 148 | public function update($id, ClientRequest $request) |
| 149 | 149 | { |
@@ -156,7 +156,6 @@ discard block |
||
| 156 | 156 | /** |
| 157 | 157 | * Remove the specified resource from storage. |
| 158 | 158 | * |
| 159 | - * @param int $id |
|
| 160 | 159 | * |
| 161 | 160 | * @return Response |
| 162 | 161 | */ |
@@ -42,11 +42,11 @@ discard block |
||
| 42 | 42 | public function GetAddons() |
| 43 | 43 | { |
| 44 | 44 | return \Datatable::collection($this->addon->get()) |
| 45 | - ->addColumn('#', function ($model) { |
|
| 45 | + ->addColumn('#', function($model) { |
|
| 46 | 46 | return "<input type='checkbox' value=".$model->id.' name=select[] id=check>'; |
| 47 | 47 | }) |
| 48 | 48 | ->showColumns('name', 'regular_price', 'selling_price') |
| 49 | - ->addColumn('associated', function ($model) { |
|
| 49 | + ->addColumn('associated', function($model) { |
|
| 50 | 50 | $relations = new ProductAddonRelation(); |
| 51 | 51 | $relations = $relations->where('addon_id', $model->id)->get(); |
| 52 | 52 | $products = []; |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | |
| 57 | 57 | return implode(',', $products); |
| 58 | 58 | }) |
| 59 | - ->addColumn('action', function ($model) { |
|
| 59 | + ->addColumn('action', function($model) { |
|
| 60 | 60 | return '<a href='.url('addons/'.$model->id.'/edit')." class='btn btn-sm btn-primary'>Edit</a>"; |
| 61 | 61 | }) |
| 62 | 62 | ->searchColumns('name') |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | /** |
| 63 | 63 | * Store a newly created resource in storage. |
| 64 | 64 | * |
| 65 | - * @return Response |
|
| 65 | + * @return \Illuminate\Http\RedirectResponse |
|
| 66 | 66 | */ |
| 67 | 67 | public function store(Request $request) { |
| 68 | 68 | $this->service->fill($request->input())->save(); |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | * Update the specified resource in storage. |
| 97 | 97 | * |
| 98 | 98 | * @param int $id |
| 99 | - * @return Response |
|
| 99 | + * @return \Illuminate\Http\RedirectResponse |
|
| 100 | 100 | */ |
| 101 | 101 | public function update($id, Request $request) { |
| 102 | 102 | $service = $this->service->where('id',$id)->first(); |
@@ -47,11 +47,11 @@ discard block |
||
| 47 | 47 | public function GetBundles() |
| 48 | 48 | { |
| 49 | 49 | return \Datatable::collection($this->bundle->select('id', 'name', 'valid_from', 'valid_till', 'uses', 'maximum_uses')->get()) |
| 50 | - ->addColumn('#', function ($model) { |
|
| 50 | + ->addColumn('#', function($model) { |
|
| 51 | 51 | return "<input type='checkbox' value=".$model->id.' name=select[] id=check>'; |
| 52 | 52 | }) |
| 53 | 53 | ->showColumns('name', 'valid_from', 'valid_till', 'uses', 'maximum_uses') |
| 54 | - ->addColumn('item', function ($model) { |
|
| 54 | + ->addColumn('item', function($model) { |
|
| 55 | 55 | $name = $this->relation->where('bundle_id', $model->id)->pluck('product_id'); |
| 56 | 56 | //dd($name); |
| 57 | 57 | $result = []; |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | //dd($result); |
| 62 | 62 | return implode(',', $result); |
| 63 | 63 | }) |
| 64 | - ->addColumn('action', function ($model) { |
|
| 64 | + ->addColumn('action', function($model) { |
|
| 65 | 65 | return '<a href='.url('bundles/'.$model->id.'/edit')." class='btn btn-sm btn-primary'>Edit</a>"; |
| 66 | 66 | }) |
| 67 | 67 | ->searchColumns('name', 'item') |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | /** |
| 63 | 63 | * Store a newly created resource in storage. |
| 64 | 64 | * |
| 65 | - * @return Response |
|
| 65 | + * @return \Illuminate\Http\RedirectResponse |
|
| 66 | 66 | */ |
| 67 | 67 | public function store(Request $request) { |
| 68 | 68 | $this->service->fill($request->input())->save(); |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | * Update the specified resource in storage. |
| 97 | 97 | * |
| 98 | 98 | * @param int $id |
| 99 | - * @return Response |
|
| 99 | + * @return \Illuminate\Http\RedirectResponse |
|
| 100 | 100 | */ |
| 101 | 101 | public function update($id, Request $request) { |
| 102 | 102 | $service = $this->service->where('id',$id)->first(); |
@@ -47,11 +47,11 @@ discard block |
||
| 47 | 47 | public function GetGroups() |
| 48 | 48 | { |
| 49 | 49 | return \Datatable::collection($this->group->select('id', 'name')->where('id', '!=', 1)->get()) |
| 50 | - ->addColumn('#', function ($model) { |
|
| 50 | + ->addColumn('#', function($model) { |
|
| 51 | 51 | return "<input type='checkbox' value=".$model->id.' name=select[] id=check>'; |
| 52 | 52 | }) |
| 53 | 53 | ->showColumns('name') |
| 54 | - ->addColumn('features', function ($model) { |
|
| 54 | + ->addColumn('features', function($model) { |
|
| 55 | 55 | |
| 56 | 56 | $features = $this->feature->select('features')->where('group_id', $model->id)->get(); |
| 57 | 57 | //dd($features); |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | //dd($result); |
| 64 | 64 | return implode(',', $result); |
| 65 | 65 | }) |
| 66 | - ->addColumn('action', function ($model) { |
|
| 66 | + ->addColumn('action', function($model) { |
|
| 67 | 67 | return '<a href='.url('groups/'.$model->id.'/edit')." class='btn btn-sm btn-primary'>Edit</a>"; |
| 68 | 68 | }) |
| 69 | 69 | ->searchColumns('name') |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | /** |
| 84 | 84 | * Store a newly created resource in storage. |
| 85 | 85 | * |
| 86 | - * @return Response |
|
| 86 | + * @return \Illuminate\Http\RedirectResponse |
|
| 87 | 87 | */ |
| 88 | 88 | public function store(ClientRequest $request) |
| 89 | 89 | { |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | * |
| 144 | 144 | * @param int $id |
| 145 | 145 | * |
| 146 | - * @return Response |
|
| 146 | + * @return \Illuminate\Http\RedirectResponse |
|
| 147 | 147 | */ |
| 148 | 148 | public function update($id, ClientRequest $request) |
| 149 | 149 | { |
@@ -156,7 +156,6 @@ discard block |
||
| 156 | 156 | /** |
| 157 | 157 | * Remove the specified resource from storage. |
| 158 | 158 | * |
| 159 | - * @param int $id |
|
| 160 | 159 | * |
| 161 | 160 | * @return Response |
| 162 | 161 | */ |
@@ -46,23 +46,23 @@ discard block |
||
| 46 | 46 | //dd($user); |
| 47 | 47 | |
| 48 | 48 | return \Datatable::query($user) |
| 49 | - ->addColumn('#', function ($model) { |
|
| 49 | + ->addColumn('#', function($model) { |
|
| 50 | 50 | return "<input type='checkbox' value=".$model->id.' name=select[] id=check>'; |
| 51 | 51 | }) |
| 52 | - ->addColumn('first_name', function ($model) { |
|
| 52 | + ->addColumn('first_name', function($model) { |
|
| 53 | 53 | return '<a href='.url('clients/'.$model->id).'>'.ucfirst($model->first_name).' '.ucfirst($model->last_name).'</a>'; |
| 54 | 54 | }) |
| 55 | 55 | |
| 56 | 56 | ->showColumns('email', 'created_at') |
| 57 | 57 | |
| 58 | - ->addColumn('active', function ($model) { |
|
| 58 | + ->addColumn('active', function($model) { |
|
| 59 | 59 | if ($model->active == 1) { |
| 60 | 60 | return "<span style='color:green'>Activated</span>"; |
| 61 | 61 | } else { |
| 62 | 62 | return "<span style='color:red'>Not activated</span>"; |
| 63 | 63 | } |
| 64 | 64 | }) |
| 65 | - ->addColumn('action', function ($model) { |
|
| 65 | + ->addColumn('action', function($model) { |
|
| 66 | 66 | return '<a href='.url('clients/'.$model->id.'/edit')." class='btn btn-sm btn-primary'>Edit</a>"; |
| 67 | 67 | }) |
| 68 | 68 | ->searchColumns('email', 'first_name') |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | $token = str_random(40); |
| 99 | 99 | $this->activate->create(['email' => $user->email, 'token' => $token]); |
| 100 | 100 | |
| 101 | - \Mail::send('emails.welcome', ['token' => $token, 'email' => $user->email, 'pass' => $str], function ($message) use ($user) { |
|
| 101 | + \Mail::send('emails.welcome', ['token' => $token, 'email' => $user->email, 'pass' => $str], function($message) use ($user) { |
|
| 102 | 102 | $message->to($user->email, $user->first_name)->subject('Welcome!'); |
| 103 | 103 | }); |
| 104 | 104 | |
@@ -39,6 +39,9 @@ |
||
| 39 | 39 | |
| 40 | 40 | //*********** Padding Function ********************* |
| 41 | 41 | |
| 42 | + /** |
|
| 43 | + * @param integer $blockSize |
|
| 44 | + */ |
|
| 42 | 45 | public function pkcs5_pad($plainText, $blockSize) |
| 43 | 46 | { |
| 44 | 47 | $pad = $blockSize - (strlen($plainText) % $blockSize); |
@@ -39,12 +39,12 @@ |
||
| 39 | 39 | |
| 40 | 40 | //*********** Padding Function ********************* |
| 41 | 41 | |
| 42 | - public function pkcs5_pad($plainText, $blockSize) |
|
| 43 | - { |
|
| 44 | - $pad = $blockSize - (strlen($plainText) % $blockSize); |
|
| 42 | + public function pkcs5_pad($plainText, $blockSize) |
|
| 43 | + { |
|
| 44 | + $pad = $blockSize - (strlen($plainText) % $blockSize); |
|
| 45 | 45 | |
| 46 | - return $plainText.str_repeat(chr($pad), $pad); |
|
| 47 | - } |
|
| 46 | + return $plainText.str_repeat(chr($pad), $pad); |
|
| 47 | + } |
|
| 48 | 48 | |
| 49 | 49 | //********** Hexadecimal to Binary function for php 4.0 version ******** |
| 50 | 50 | |
@@ -127,7 +127,7 @@ |
||
| 127 | 127 | { |
| 128 | 128 | \DB::table('products')->delete(); |
| 129 | 129 | Product::create(['id' => 1, 'name' => 'default', 'type' => 1, 'group' => 1]); |
| 130 | - //Product::create(['id'=>2,'name'=>'none1','type'=>1,'group' =>1]); |
|
| 130 | + //Product::create(['id'=>2,'name'=>'none1','type'=>1,'group' =>1]); |
|
| 131 | 131 | } |
| 132 | 132 | } |
| 133 | 133 | |
@@ -8,7 +8,6 @@ |
||
| 8 | 8 | use App\Model\Payment\PromotionType; |
| 9 | 9 | use App\Model\Product\Product; |
| 10 | 10 | use App\Model\Product\ProductGroup; |
| 11 | -use App\Model\Product\Subscription; |
|
| 12 | 11 | use App\Model\Product\Type; |
| 13 | 12 | use Illuminate\Database\Eloquent\Model; |
| 14 | 13 | use Illuminate\Database\Seeder; |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | public function up() |
| 14 | 14 | { |
| 15 | - Schema::create('product_bundles', function (Blueprint $table) { |
|
| 15 | + Schema::create('product_bundles', function(Blueprint $table) { |
|
| 16 | 16 | $table->increments('id'); |
| 17 | 17 | $table->string('name'); |
| 18 | 18 | $table->timestamp('valid_from'); |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | public function up() |
| 14 | 14 | { |
| 15 | - Schema::create('password_resets', function (Blueprint $table) { |
|
| 15 | + Schema::create('password_resets', function(Blueprint $table) { |
|
| 16 | 16 | $table->string('email')->index(); |
| 17 | 17 | $table->string('token')->index(); |
| 18 | 18 | $table->timestamp('created_at'); |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | public function up() |
| 14 | 14 | { |
| 15 | - Schema::create('account_activates', function (Blueprint $table) { |
|
| 15 | + Schema::create('account_activates', function(Blueprint $table) { |
|
| 16 | 16 | $table->string('email')->index(); |
| 17 | 17 | $table->string('token')->index(); |
| 18 | 18 | $table->timestamps(); |