sarga/packages/Webkul/API/Http/api.php

59 lines
2.4 KiB
PHP
Raw Normal View History

2018-11-17 13:56:48 +00:00
<?php
2018-11-24 09:56:31 +00:00
Route::group(['middleware' => 'api','namespace' => 'Webkul\API\Http\Controllers\Customer', 'prefix' => 'api/customer'], function ($router) {
2018-11-22 16:47:20 +00:00
Route::post('/register', 'RegistrationController@create');
});
2018-11-21 06:29:18 +00:00
Route::group(['namespace' => 'Webkul\API\Http\Controllers\Customer', 'prefix' => 'api/customer'], function ($router) {
//auth route for customer
Route::post('login', 'AuthController@create');
//auth route for customer
Route::post('logout', 'AuthController@destroy');
//get customer profile
Route::get('get/profile', 'CustomerController@getProfile');
Route::put('update/profile/{id}', 'CustomerController@updateProfile');
2018-11-21 06:29:18 +00:00
//wishlist
2018-11-24 09:56:31 +00:00
//get wishlist
2018-11-21 06:29:18 +00:00
Route::get('get/wishlist', 'WishlistController@getWishlist');
2018-11-24 09:56:31 +00:00
//add the item in the wishlist
Route::get('add/wishlist/{id}', 'WishlistController@add');
//delete the item from the wishlist
Route::get('delete/wishlist/{id}', 'WishlistController@delete');
//Move the item from the wishlist to cart
// Route::get('delete/wishlist/{id}', 'WishlistController@delete');
2018-11-21 06:29:18 +00:00
//address
Route::get('get/address', 'AddressController@get');
Route::get('get/default/address', 'AddressController@getDefault');
Route::post('create/address', 'AddressController@create');
Route::put('make/default/address/{id}', 'AddressController@makeDefault');
Route::delete('delete/address/{id}', 'AddressController@delete');
2018-11-21 06:29:18 +00:00
//cart
//active + inactive instances of cart for the current logged in user
2018-11-24 13:54:54 +00:00
Route::get('get/all', 'CustomerController@getAllCart');
2018-11-21 06:29:18 +00:00
//active instances of cart for the current logged in user
2018-11-24 13:54:54 +00:00
Route::get('get/active', 'CustomerController@getActiveCart');
2018-11-21 06:29:18 +00:00
});
2018-11-24 09:56:31 +00:00
Route::group(['namespace' => 'Webkul\API\Http\Controllers\Shop', 'prefix' => 'api/cart'], function ($router) {
//cart
2018-11-24 13:54:54 +00:00
Route::get('get', 'CartController@get');
2018-11-24 09:56:31 +00:00
//add item in the cart
2018-11-24 13:54:54 +00:00
Route::post('add/{id}', 'CartController@add');
2018-11-24 09:56:31 +00:00
//remove item to the cart
2018-11-24 13:54:54 +00:00
Route::get('remove/{id}', 'CartController@remove');
2018-11-24 09:56:31 +00:00
});
2018-11-21 06:29:18 +00:00
Route::group(['namespace' => 'Webkul\API\Http\Controllers\Product', 'prefix' => 'api/product'], function ($router) {
//product
//to fetch the new product
Route::get('get/all', 'ProductController@getAllProducts');
});
Route::group(['namespace' => 'Webkul\API\Http\Controllers\Admin', 'prefix' => 'api/admin'], function ($router) {
});