From 516bb3244f271ef1a4b124627c692107ec9cbdce Mon Sep 17 00:00:00 2001 From: Maciej Fikus Date: Thu, 20 Sep 2018 13:01:35 +0200 Subject: [PATCH] Added validation rules for a slug field --- src-php/Role.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-php/Role.php b/src-php/Role.php index eed12c0..7ab873b 100644 --- a/src-php/Role.php +++ b/src-php/Role.php @@ -57,7 +57,7 @@ public function fields(Request $request) return [ ID::make()->sortable(), TextWithSlug::make('Name')->sortable()->slug('Slug'), - Slug::make('Slug')->sortable(), + Slug::make('Slug')->rules('required', 'unique:roles')->sortable(), Checkboxes::make('Permissions')->options(collect(Policy::all())->mapWithKeys(function ($policy) { return [