forked from mirror/pixelfed
Add Like ap validator
This commit is contained in:
parent
92f2d5cf74
commit
12d4bd7fe4
1 changed files with 25 additions and 0 deletions
25
app/Util/ActivityPub/Validator/Like.php
Normal file
25
app/Util/ActivityPub/Validator/Like.php
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
namespace App\Util\ActivityPub\Validator;
|
||||
|
||||
use Validator;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class Like {
|
||||
|
||||
public static function validate($payload)
|
||||
{
|
||||
$valid = Validator::make($payload, [
|
||||
'@context' => 'required',
|
||||
'id' => 'required|string',
|
||||
'type' => [
|
||||
'required',
|
||||
Rule::in(['Like'])
|
||||
],
|
||||
'actor' => 'required|url|active_url',
|
||||
'object' => 'required|url|active_url'
|
||||
])->passes();
|
||||
|
||||
return $valid;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue