add utils
This commit is contained in:
parent
d580af9691
commit
aaa629a385
1 changed files with 3 additions and 2 deletions
|
|
@ -10,12 +10,13 @@ use App\Foo\Bar;
|
|||
$path = 'path/to/file';
|
||||
$file = FileAttribute::handleFile($path); // returns an instance of File
|
||||
|
||||
$path = 'path/to/file';
|
||||
$file = FileAttribute::handleFile($path, Bar::class); // returns an instance of Bar
|
||||
|
||||
$path = 'path/to/removed_file';
|
||||
$file = FileAttribute::handleFile($path); // returns null
|
||||
|
||||
$path = null;
|
||||
$file = FileAttribute::handleFile($path); // returns null
|
||||
|
||||
$path = 'path/to/file';
|
||||
$file = FileAttribute::handleFile($path, Bar::class); // returns an instance of Bar
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue