Guest User

Untitled

a guest
Jan 15th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. protected $fillable = [
  2. 'name',
  3. 'caption',
  4. 'path'
  5. ];
  6.  
  7. public static function create(array $attributes, $image, $extension, $folder = null)
  8. {
  9. die("It died.");
  10. $attributes['path'] = FileNameGenerator::getNewFilePath($extension);
  11.  
  12. Storage::disk('s3')->put( $folder . $attributes['path'], File::get($image));
  13.  
  14. $model = static::query()->create($attributes);
  15. return $model;
  16. }
  17.  
  18. Auth::user()->image()->create([], $image, $extension, config('app.profile_pictures_path'));
Add Comment
Please, Sign In to add comment