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
composer require bagisto/rest-api dev-master
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.
http://localhost/bagisto2.0beta/bagisto/public/api/v1/customer/login
- for login the customer add the HasApiTokens in the Webkul\Customer\Models\Customer use in namespace in admin model use Laravel\Sanctum\HasApiTokens; use Webkul\Product\Models\ProductReviewProxy; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Foundation\Auth\User as Authenticatable; use Webkul\Sales\Models\InvoiceProxy; use Illuminate\Support\Facades\Storage; use Illuminate\Notifications\Notifiable; use Webkul\Sales\Models\OrderProxy;
http://localhost/bagisto2.0beta/bagisto/public/api/v1/admin/login
- for login the admin add the HasApiTokens in the Webkul\User\Models\admin use in namespace in admin model use Laravel\Sanctum\HasApiTokens; use Illuminate\Support\Facades\Storage; use Illuminate\Notifications\Notifiable; use Webkul\User\Database\Factories\AdminFactory; use Webkul\User\Contracts\Admin as AdminContract; use Webkul\Admin\Mail\Admin\ResetPasswordNotification;
In sanctum.php add
'token_prefix' => env('SANCTUM_TOKEN_PREFIX', ''),