PHP code example of akkurateio / laravel-media
1. Go to this page and download the library: Download akkurateio/laravel-media 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/ */
akkurateio / laravel-media example snippets
bash
php artisan vendor:publish --provider="Akkurate\LaravelMedia\LaravelMediaServiceProvider" --tag="config"
bash
php artisan migrate
bash
php artisan media:seed
$resource->addMedia($file)
bash
GET /media/resources?}
// Attacher une resource à n’importe quel model
POST /media/resources/{id}/attach // params: *model_type, *model_id
// Supprimer une association resource/model
POST /media/resources/{id}/detach // params: *model_type, *model_id
// Gestion des tags sur les resources
POST /media/resources/{id}/tags/attach // params: *tag
POST /media/resources/{id}/tags/detach // params: *tag