1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-25 01:05:36 +00:00
pixelfed/app/Util/ActivityPub/Validator/Follow.php

25 lines
418 B
PHP
Raw Normal View History

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;
}
}