roopchandkashyap / laravel-eloquent-files-with-aws-s3
File Handling with Eloquent Models and AWS Bucket S3 in Laravel
Installs: 24
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/roopchandkashyap/laravel-eloquent-files-with-aws-s3
Requires
- laravel/framework: ^5.4
This package is auto-updated.
Last update: 2025-11-29 02:12:08 UTC
README
Installation using Composer:
composer require roopchandkashyap/laravel-eloquent-files-with-aws-s3
Usage:
In your eloquent model use \roopchandkashyap\EloquentFiles\HasFile trait and create a method for accessing file like below:
<?php
namespace App\Model;
use Illuminate\Database\Eloquent\Model;
class Member extends Model {
use \roopchandkashyap\EloquentFiles\HasFile;
function getImageAttribute() {
return $this->file_info("image_path");
}
}
Here "image_path" is the attribute/column name on which you want to assign the path of the uploaded file, default is "file_path".
The second argument accepted by the file_info() method is the array of the following options.
| Name | Value |
|---|---|