1
0
Fork 0
forked from mirror/pixelfed

Add Follow ap validator

This commit is contained in:
Daniel Supernault 2019-01-12 01:22:12 -07:00
parent a6228ffce7
commit 92f2d5cf74
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -0,0 +1,25 @@
<?php
namespace App\Util\ActivityPub\Validator;
use Validator;
use Illuminate\Validation\Rule;
class Follow {
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;
}
}