add utils
This commit is contained in:
parent
d580af9691
commit
aaa629a385
|
@ -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…
Reference in a new issue