2017 © Pedro Peláez
 

library laravel-eloquent-files

File Handling with Eloquent Models in Laravel

image

shridharkaushik29/laravel-eloquent-files

File Handling with Eloquent Models in Laravel

  • Saturday, June 16, 2018
  • by shridharkaushik29
  • Repository
  • 0 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Eloquent Files

Installation using Composer:, (*1)

composer require shridharkaushik29/laravel-eloquent-files, (*2)

Usage:, (*3)

In your eloquent model use \Shridhar\EloquentFiles\HasFile trait and create a method for accessing file like below:, (*4)


<?php

namespace App\Model;

use Illuminate\Database\Eloquent\Model;

class Member extends Model {

    use \Shridhar\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"., (*5)

The second argument accepted by the file_info() method is the array of the following options., (*6)

Name Value

The Versions

16/06 2018

dev-master

9999999-dev

File Handling with Eloquent Models in Laravel

  Sources   Download

MIT

The Requires

 

by Shridhar Sharma

16/06 2018

1.0.0

1.0.0.0

File Handling with Eloquent Models in Laravel

  Sources   Download

MIT

The Requires

 

by Shridhar Sharma