Laravel Bible helps you fetch from the Holy Bible
You can install the package via composer:
composer require djunehor/laravel-bible
The package will automatically register itself, so you can start using it immediately.
In Laravel version 5.4 and older, you have to add the service provider in config/app.php
file manually:
'providers' => [
// ...
Djunehor\Logos\BibleServiceProvider::class,
];
After installing the package, you will have to register it in bootstrap/app.php
file manually:
// Register Service Providers
// ...
$app->register(Djunehor\Logos\BibleServiceProvider::class);
];
use Djunehor\Logos\Bible;
$bible = new Bible();
$bible->book('John');
$john = $bible->getBook();
$bible->book('Matthew');
$bible->chapter(3);
$verses = $bible->getChapter();
$bible->book('Mark');
$bible->chapter(3);
$bible->verse(12);
$verse = $bible->getVerse();
// get Genesis 22:6
$verse = $bible->get('Genesis 22:6');
// Bible Class accepts 2 parameters: $lang and $version
$lang = 'en';
$bible = new Bible('en'); // use English version
$bible = new Bible('en', 'kjv'); // use English KJV bible
In order to use the Bible facade:
- First add
'Bible' => Djunehor\Logos\Facades\BibleFacade::class,
to aliases inconfig/app.php
- Then use like
Bible::get('John 3:16');
The package ships with a bible()
method
bible('John 3:16');
$bible = new Bible(); // lang is set to "en", and version is set to "kjv" by default;
$bible->lang('yo'); // Set language as Yoruba
$bible->version('amp'); // Set version to Amplified Version
Language | Code | Versions |
---|---|---|
English | en | kjv |
Simply follow the structure of the bibles/en
folder
- Fork this project
- Clone to your repo
- Make your changes and run tests
composer test
- Push and create a pull request
- The KJV English bible JSON file was sourced from here