PHP code example of rakshitbharat / laravel-storage-with-database

1. Go to this page and download the library: Download rakshitbharat/laravel-storage-with-database 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/ */

    

rakshitbharat / laravel-storage-with-database example snippets


'disks' => [
    // ... other disks ...
    'database' => [
        'driver' => 'database'
    ],
],

use Illuminate\Support\Facades\Storage;

Storage::disk('database')->put('key', 'value');

use Illuminate\Support\Facades\Storage;

$value = Storage::disk('database')->get('key');

use Illuminate\Support\Facades\Storage;

$exists = Storage::disk('database')->exists('key');

use Illuminate\Support\Facades\Storage;

Storage::disk('database')->delete('key');
bash
php artisan vendor:publish --provider="Rakshitbharat\LaravelStorageWithDatabase\StorageDatabaseServiceProvider" --tag="config"
bash
php artisan migrate