PHP code example of kingofcode / laravel-uploadable
1. Go to this page and download the library: Download kingofcode/laravel-uploadable 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/ */
kingofcode / laravel-uploadable example snippets
use KingOfCode\Upload\Uploadable;
class Product extends Model
{
use Uploadable;
protected $fillable = [
'name',
'type',
// Avoid adding file fields in the fillable array, it can break the correct upload
];
// Array of uploadable images. These fields need to be existent in your database table
protected $uploadableImages = [
'image',
'perfil_image',
'test_image'
];
// Array of uploadable files. These fields need to be existent in your database table
protected $uploadableFiles = [
'pdf'
];
}