Example of Custom validation rules in LaraBug/larabug-app

File app/Rules/StartsWith.php (link to Github)
use Illuminate\Contracts\Validation\Rule;

class StartsWith implements Rule
{
    public function passes($attribute, $value)
    {
        return starts_with($value, $this->starts);
    }

    public function message()
    {
        $str = '';
        if (is_array($this->starts)) {
            $i = 0;
            foreach ($this->starts as $start) {
                $str .= ($i !== 0 ? 'or' : null) . ' ' . $start;
                $i++;
            }
        } else {
            $str = $this->starts;
        }

        return 'The :attribute must start with ' . $str;
    }
}
File app/Http/Requests/ProjectRequest.php (link to Github)
use App\Rules\StartsWith;
use Illuminate\Foundation\Http\FormRequest;

class ProjectRequest extends FormRequest
{
    public function rules()
    {
        return [
            'slack_webhook' => [
                'url',
                'nullable',
                new StartsWith('https://hooks.slack.com/services/')
            ],
            'discord_webhook' => [
                'url',
                'nullable',
                new StartsWith(['https://discordapp.com/api/webhooks/', 'https://discord.com/api/webhooks/'])
            ],
        ];
    }
}

Additional resources on custom validation rules: