devforislam / quran-api
Api to access the holy Quran's Ayah
Installs: 37
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 3
Forks: 0
Open Issues: 0
Type:project
Requires
- fruitcake/laravel-cors: ^1.0
- league/fractal: ^0.18.0
This package is auto-updated.
Last update: 2024-12-15 20:55:18 UTC
README
- Install Package
- Import Quran Database
- Install Passport for Auth
- Features
- Download Api Collection
- Api Documentation
Install package
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
Quran Database
Download the quran-database and import to your database.
Install Passport
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 API Collection
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.