Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2485252
SharedFolderType.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
899 B
Referenced Files
None
Subscribers
None
SharedFolderType.php
View Options
<?php
namespace
App\Rules
;
use
Illuminate\Contracts\Validation\Rule
;
use
Illuminate\Support\Facades\Validator
;
use
Illuminate\Support\Str
;
class
SharedFolderType
implements
Rule
{
private
$message
;
/**
* Determine if the validation rule passes.
*
* @param string $attribute Attribute name
* @param mixed $type Shared folder type input
*
* @return bool
*/
public
function
passes
(
$attribute
,
$type
):
bool
{
if
(
empty
(
$type
)
||
!
is_string
(
$type
)
||
!
in_array
(
$type
,
\App\SharedFolder
::
SUPPORTED_TYPES
))
{
$this
->
message
=
\trans
(
'validation.entryinvalid'
,
[
'attribute'
=>
$attribute
]);
return
false
;
}
return
true
;
}
/**
* Get the validation error message.
*
* @return string
*/
public
function
message
():
?
string
{
return
$this
->
message
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Nov 21, 11:47 AM (1 d, 21 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
387459
Default Alt Text
SharedFolderType.php (899 B)
Attached To
Mode
R2 kolab
Attached
Detach File
Event Timeline
Log In to Comment