2019-01-12 08:22:12 +00:00
|
|
|
<?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',
|
2019-01-12 08:25:21 +00:00
|
|
|
Rule::in(['Follow'])
|
2019-01-12 08:22:12 +00:00
|
|
|
],
|
2020-04-30 02:27:36 +00:00
|
|
|
'actor' => 'required|url',
|
|
|
|
'object' => 'required|url'
|
2019-01-12 08:22:12 +00:00
|
|
|
])->passes();
|
|
|
|
|
|
|
|
return $valid;
|
|
|
|
}
|
|
|
|
}
|