LaravelPackages.net
Acme Inc.
Toggle sidebar
roopchandkashyap/laravel-eloquent-files-with-aws-s3

File Handling with Eloquent Models and AWS Bucket S3 in Laravel

24
0
About roopchandkashyap/laravel-eloquent-files-with-aws-s3

roopchandkashyap/laravel-eloquent-files-with-aws-s3 is a Laravel package for file handling with eloquent models and aws bucket s3 in laravel. It currently has 0 GitHub stars and 24 downloads on Packagist. Install it with composer require roopchandkashyap/laravel-eloquent-files-with-aws-s3. Discover more Laravel packages by roopchandkashyap or browse all Laravel packages to compare alternatives.

Last updated

Eloquent Files with AWS storage S3 Bucket Config

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

Star History Chart