PHP code example of ozankurt / laravel-modules-media-library

1. Go to this page and download the library: Download ozankurt/laravel-modules-media-library 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/ */

    

ozankurt / laravel-modules-media-library example snippets


// config/media-library.php
'contracts' => [
    'ocr'       => \App\Media\TesseractOcr::class,     // implements Storage\Contracts\OcrExtractor
    'ai_tagger' => \App\Media\VisionTagger::class,     // implements Storage\Contracts\AiTagger
    'scout'     => \App\Media\ScoutIndexer::class,     // implements Search\Contracts\ScoutAdapter
],

'http' => [
    'mode' => env('MEDIA_LIBRARY_HTTP_MODE', 'headless'), // headless | api | ui
    'prefix' => 'api/media',
    'middleware' => ['api'],
    'auth_middleware' => ['auth'],   // e.g. ['auth:sanctum'] for token auth
    'rate_limit' => '60,1',          // maxAttempts,decayMinutes
],

use Kurt\Modules\MediaLibrary\Filament\MediaLibraryPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->plugin(MediaLibraryPlugin::make());
}
bash
composer vendor:publish --tag=media-library-config
php artisan vendor:publish --tag=media-library-migrations
php artisan migrate