1. Go to this page and download the library: Download teamteatime/laravel-filer 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/ */
teamteatime / laravel-filer example snippets
TeamTeaTime\Filer\FilerServiceProvider::class,
class ... extends Eloquent {
use \TeamTeaTime\Filer\HasAttachments;
}
$user->attach('avatars/1.jpg'); // path relative to your configured storage directory
$article->attach($pdf, ['title' => "Event 2015 Guide", 'description' => "The complete guide for this year's event."]);
$user->attach($photo, ['user_id' => $user->id]);
$article->attach($pdf, ['user_id' => null]);
$user->attachments()->find($attachmentId);
$user->findAttachmentByKey('avatar');
$avatar = $user->findAttachmentByKey('avatar');
$avatar->getUrl(); // the URL to the file (see below)
$avatar->getDownloadUrl(); // the download URL to the file (see below)
$avatar->title; // the attachment title, if any
$avatar->description; // the attachment description, if any
// If the attachment is a LocalFile...
$avatar->item->filename; // the filename, with its extension
$avatar->item->path; // the path to the directory where the file exists
$avatar->item->mimetype; // the file's detected MIME type
$avatar->item->size; // the file size, in bytes
$avatar->item->getFile(); // the Symfony File representation of the file
$avatar->item->hash; // the unique hash generated for the file (if filer.hash_routes is enabled)
route('filer.file.view', $fileId);
route('filer.file.download', $fileId)
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.