- Install Package
- Import Quran Database
- Install Passport for Auth
- Features
- Download Api Collection
- Api Documentation
Install devforislam/quran-api
via Composer package manager:
composer require devforislam/quran-api
Add DevForIslam\QuranApi\Supports\Favoritable
trait to App\User
model:
<?php
namespace App;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use DevForIslam\QuranApi\Supports\Favoritable;
class User extends Authenticatable
{
use Favoritable, Notifiable;
}
Migrate the migrations
php artisan migrate
Download the quran-database and import to your database.
We used laravel/passport for api authentication. You can install Passport via the Composer package manager:
composer require laravel/passport
Migrate passport migrations:
php artisan migrate
Install passport:
php artisan passport:install
Add the Laravel\Passport\HasApiTokens
trait to your App\User
model.
<?php
namespace App;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Passport\HasApiTokens;
class User extends Authenticatable
{
use HasApiTokens, Favoritable, Notifiable;
}
Now set passport
as authentication driver in config/auth.php
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
'api' => [
'driver' => 'passport',
'provider' => 'users',
],
],
Download the post api-collection. Now, set the url
and token
as postman environment variable. The value of token
will be user's access_token
. To see th API documentation click here.
You are most welcome to contribute in this project or You have any suggestion email me to devforislam@gmail.com or mahbub.rucse@gmail.com.