Download the PHP package 0config/file-cabinet without Composer
On this page you can find all versions of the php package 0config/file-cabinet. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package file-cabinet
Note: if you get 'Unable to create the directory' error in laravel (on the server)
- please make sure you have
storage
folder inpublic
folder - with permission
chmod 777 storage/
- please see how this file permission should look like below
Enable logging
add a log channel to config/logging.php
like this inside 'channels' =>
node
// Try writing log as below , from you application
and see : tail -f storage/logs/file_cabinet.log
If config is not done properly, log may end up in standard log
Migrate :
move migration folder to local migration mv vendor/0config/file-cabinet/src/database/migrations/*.php database/migrations
migrate up : php artisan migrate
Note: if migrate up does not work, Please run php artisan migrate --path=vendor/0config/file-cabinet/src/database/migrations/
Route example from local / web.php :
create view in appropriate local path
- file name
local_upload.blade.php
location:resources/views
make sure to load this template from route file :
eg: /local_files/image/FileCabinet/3:1::0
this will CREATE
an entry for FileCabinet
model's id= 2, set channel = 1 and ::0
will create a new record
e.g.: /local_files/image/FileCabinet/1:5::12
this will UPDATE
entry for FileCabinet
model's id= 1, set channel = 5 and ::12
will update FileCabinet.id = 12
Relationships :
in User
model : add below
in your web.php // add routes
now create some records and browse :
: http://localhost:8000/users/1
/users/1
/users/2
you should get desired response.
Destroy
/local_files/{mimetype}/destroy/{model_name}/{model_id}:{channel}::{id}/
see there is destroy
between routes, rest is same
Restrict and relax ownership :
UploadFileController::upsert($request, false); // default 2nd param is true
if you set it to false ownership is not checked
BE VERY CAREFUL this will transfer ownership as well..