config/filesystems.php
1. custom disc를 설정
<?php
return [
	...
    'disks' => [
        ...
        'data' => [
            'driver' => 'local',
            'root' => '/customFileDirectory',
        ],
    ],
];
File::fileUpload()
1. custom disc 를 storeAs 에 세번째 인수로 전달
function imageFileUpload($fileobject, $filename, $extension) 
{
  $savefilename = $filename.".".$extension;
  return $savepath = $fileobject->storeAs('public', $savefilename, 'data');
}
반응형
    
    
    
  '개발 > Laravel' 카테고리의 다른 글
| Laravel Pagination (0) | 2020.07.02 | 
|---|---|
| Laravel Storage 외부 파일 조회 (0) | 2020.06.27 | 
| Laravel Eloquent Static Method (0) | 2020.06.24 | 
| Laravel Singleton 구현 (0) | 2020.06.24 | 
| Laravel Dependency Injection Container - 1 (0) | 2020.06.23 |