PHP code example of wenprise / laravel-media-library

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

    

wenprise / laravel-media-library example snippets


return [
    'models' => [
        'media' => App\Models\MediaAsset::class,
        'attachment' => App\Models\MediaAttachment::class,
        'user' => App\Models\User::class,
    ],
    'routes' => [
        'enabled' => true,
        'prefix' => 'api/admin/media',
        'name_prefix' => 'admin.media.',
        'middleware' => ['web', 'auth', 'permission:media.manage'],
        'controller' => App\Http\Controllers\Admin\MediaAssetController::class,
    ],
    'usage_inspectors' => [App\Media\ProjectMediaUsageInspector::class],
];
bash
php artisan vendor:publish --tag=media-library-config
php artisan vendor:publish --tag=media-library-migrations
php artisan migrate
php artisan storage:link