Simple installation via Composer
composer require filerobot/storage
Your config/filesystems.php.
'filerobot' => [
'driver' => 'filerobot',
'key' => env('FILEROBOT_KEY_ID'),
]
Your .env
FILEROBOT_KEY_ID=fa5fe3303dd34e1da4810915c7c3fd6f
Storage::disk('filerobot')
Lists all files in your Filerobot container. You can alternatively search by providing a search string. Can be recursive. example: type:folder_namew
return Storage::disk('filerobot')->listContents('folder:api-demo', false);
You can add collect.
return collect(Storage::disk('filerobot')->listContents('folder:api-demo', false))->where('name','test01')->first();
Retrieving a file's or folder details over UUID requires to authenticate against the API.
return Storage::disk('filerobot')->read('63accfbe-d1a1-502b-a1f6-47397645000e');
Renames the file or folder with the value given in the body.
return Storage::disk('filerobot')->rename($uuid, $name_change);
Will move the file or folder to a new folder. The folder will be created if it doesn't already exist.
return Storage::disk('filerobot')->copy($uuid, $name_change);
Delete a file using its UUID as reference.
return Storage::disk('filerobot')->delete($file_uuid);
Multiple methods are available to suit different needs
$config = [
'name' => foder_name, // example '/api-demo'
'type' => 'multipart'
];
$image = public_path('4090e6607e8bea2c9845b12630a927fd.jpg');
$name_upload = 'test01.png';
Storage::disk('filerobot')->put($name_upload, $image,$config);
$config = [
'name' => forde_name, // example '/api-demo'
'type' => 'remote'
];
$content = [
[
"name" => 'test03.png',
"url" => 'https://www.louisvuitton.com/images/U_Tr_Brand_campaign_Milos_DI3.jpg?wid=2048'
]
];
Storage::disk('filerobot')->put(null, json_encode($content),$config);
$config = [
'name' => folder_name, // example '/api-demo'
'type' => 'base64'
];
$image = base64_encode(file_get_contents('4090e6607e8bea2c9845b12630a927fd.jpg'));
$name_upload = 'test01.png';
Storage::disk('filerobot')->put($name_upload, $image,$config);
$config = [
'name' => folder_name, // example '/api-demo'
];
$image = fopen(public_path('4090e6607e8bea2c9845b12630a927fd.jpg'),"r");
$name_upload = 'test01.png';
Storage::disk('filerobot')->put($name_upload, $image,$config);
Lists all folders in your Filerobot container. You can search by providing a search string. Can be recursive. example: type:folder_name
return Storage::disk('filerobot')->listContents('folder:api-demo', false);
Gets all information of a folder identified by its folder_uuid. This API will also allow you to check the existence of a folder.
return Storage::disk('filerobot')->read('63accfbe-d1a1-502b-a1f6-47397645000e');
Renames the folder identified by its folder_uuid to the value given in the body
return Storage::disk('filerobot')->rename($uuid, $name_change);
Will move a folder, identified by its folder_uuid to a new location (folder) which can be identified by destination_folder_uuid.
return Storage::disk('filerobot')->copy($folder_uuid, $destination_folder_uuid);
Deletes a folder and all sub-folders recursively.
return Storage::disk('filerobot')->deleteDirectory($folder_uuid);
Creates a folder from the value given in the body.
return Storage::disk('filerobot')->makeDirectory($folder_name);