PHP code example of kudastech / filament-bible

1. Go to this page and download the library: Download kudastech/filament-bible library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

kudastech / filament-bible example snippets


return [
    // Default Bible language
    'default_language' => 'en',
    
    // Default Bible version
    'default_version' => 'kjv',
    
    // Path to Bible data files
    'bibles_path' => storage_path('app/bibles'),
];

use Kudastech\Bible\Facades\Bible;

// Get a specific verse
$verse = Bible::get('Isaiah 60:1');

$verse = Bible::book('Isaiah')->chapter(60)->verse(1)->getVerse();

// Get list of available books
$books = Bible::getBooks();

use Kudastech\Bible\Actions\BibleAction;
use Filament\Forms\Components\Textarea;
use Filament\Forms\Components\TextInput;

Forms\Components\Section::make()
    ->schema([
        Forms\Components\TextInput::make('verse_reference')
            ->label('Bible Reference')
            ->helperText('Reference will be automatically filled when you fetch a verse')
            ->columnSpan('full'),
        
        Forms\Components\Textarea::make('verse_text')
            ->label('Bible Verse')
            ->rows(3)
            ->columnSpan('md'),
        
        // This is how you can use the BibleAction
        Forms\Components\Actions::make([
            BibleAction::make('fetchBibleVerse')
                ->targetField('verse_text')
                ->referenceField('verse_reference')
        ])->columnSpan('md'),
    ])
    ->columns(1),
bash
php artisan vendor:publish --tag=bible-config
bash
php artisan vendor:publish --tag=bible-files