Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
update coupon code module to laravel api routes
- Loading branch information
1 parent
437a4be
commit 9ea93e8
Showing
4 changed files
with
78 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
userfiles/modules/shop/coupons/src/ShopCouponServiceProvider.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
namespace MicroweberPackages\Modules\Shop\Coupons; | ||
|
||
|
||
use Illuminate\Support\Facades\View; | ||
use Illuminate\Support\ServiceProvider; | ||
|
||
class ShopCouponServiceProvider extends ServiceProvider | ||
{ | ||
public function register() | ||
{ | ||
$this->loadRoutesFrom(__DIR__ . '/routes/api.php'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
use Illuminate\Support\Facades\Route; | ||
|
||
\Route::name('api.') | ||
|
||
->prefix('api') | ||
->middleware(['api', 'xss', \Illuminate\Routing\Middleware\ThrottleRequests::class]) | ||
// ->namespace('MicroweberPackages\Modules\Shop\Coupons') | ||
->group(function () { | ||
|
||
Route::post('coupon_apply', function () { | ||
$data = request()->all(); | ||
return coupon_apply($data); | ||
}); | ||
Route::post('coupons_delete_session', function () { | ||
$data = request()->all(); | ||
return coupons_delete_session($data); | ||
}); | ||
|
||
}); | ||
|
||
\Route::name('api.') | ||
|
||
->prefix('api') | ||
->middleware(['api', 'xss', 'admin', \Illuminate\Routing\Middleware\ThrottleRequests::class]) | ||
// ->namespace('MicroweberPackages\Modules\Shop\Coupons') | ||
->group(function () { | ||
|
||
Route::post('coupons_save_coupon', function () { | ||
$data = request()->all(); | ||
return coupons_save_coupon($data); | ||
}); | ||
|
||
Route::post('coupon_delete', function () { | ||
$data = request()->all(); | ||
return coupon_delete($data); | ||
}); | ||
|
||
}); |