Bagisto REST API is a medium to use the features of the core Bagisto System. By using Bagisto REST API, you can integrate your application to serve the default content of Bagisto.
- Bagisto: v2.0.0
composer require bagisto/rest-api:2.0.0
composer require bagisto/rest-api:1.4.5
composer require bagisto/rest-api:dev-master
Note: It is not recommended to use the master version as it may contain breaking changes.
Add below options in the .env file (i.e. http://localhost/public your domain):
SANCTUM_STATEFUL_DOMAINS=http://localhost/public
php artisan bagisto-rest-api:install
http://localhost/public/api/admin/documentation
http://localhost/public/api/shop/documentation
- You can check the L5-Swagger guidelines too regarding the configuration the API documentation.
- To add Laravel Sanctum's API token to the Admin model follow the given path.
packages/Webkul/User/src/Models/Admin.php
<?php
namespace Webkul\User\Models;
use Laravel\Sanctum\HasApiTokens;
class Admin extends Authenticatable implements AdminContract
{
use HasApiTokens;
...
}
- To add Laravel Sanctum's API token to the customer model follow the given path.
packages/Webkul/Customer/src/Models/Customer.php
For master
<?php
namespace Webkul\Customer\Models;
use Laravel\Sanctum\HasApiTokens;
class Customer extends Authenticatable implements CustomerContract
{
use HasApiTokens;
...
}