|
@@ -502,6 +502,109 @@ class TestController extends Controller
|
|
|
// Do stuff
|
|
|
}
|
|
|
|
|
|
+ public function withInlineRequestValidateFacade()
|
|
|
+ {
|
|
|
+ // Some stuff
|
|
|
+ $validated = Request::validate([
|
|
|
+ // The id of the user. Example: 9
|
|
|
+ 'user_id' => 'int|required',
|
|
|
+ // The id of the room.
|
|
|
+ 'room_id' => ['string', 'in:3,5,6'],
|
|
|
+ // Whether to ban the user forever. Example: false
|
|
|
+ 'forever' => 'boolean',
|
|
|
+ // Just need something here. No-example
|
|
|
+ 'another_one' => 'numeric',
|
|
|
+ 'even_more_param' => 'array',
|
|
|
+ 'book.name' => 'string',
|
|
|
+ 'book.author_id' => 'integer',
|
|
|
+ 'book.pages_count' => 'integer',
|
|
|
+ 'ids.*' => 'integer',
|
|
|
+ // The first name of the user. Example: John
|
|
|
+ 'users.*.first_name' => ['string'],
|
|
|
+ // The last name of the user. Example: Doe
|
|
|
+ 'users.*.last_name' => 'string',
|
|
|
+ ]);
|
|
|
+
|
|
|
+ // Do stuff
|
|
|
+ }
|
|
|
+
|
|
|
+ public function withInlineRequestValidateFacadeNoAssignment()
|
|
|
+ {
|
|
|
+ Request::validate([
|
|
|
+ // The id of the user. Example: 9
|
|
|
+ 'user_id' => 'int|required',
|
|
|
+ // The id of the room.
|
|
|
+ 'room_id' => ['string', 'in:3,5,6'],
|
|
|
+ // Whether to ban the user forever. Example: false
|
|
|
+ 'forever' => 'boolean',
|
|
|
+ // Just need something here. No-example
|
|
|
+ 'another_one' => 'numeric',
|
|
|
+ 'even_more_param' => 'array',
|
|
|
+ 'book.name' => 'string',
|
|
|
+ 'book.author_id' => 'integer',
|
|
|
+ 'book.pages_count' => 'integer',
|
|
|
+ 'ids.*' => 'integer',
|
|
|
+ // The first name of the user. Example: John
|
|
|
+ 'users.*.first_name' => ['string'],
|
|
|
+ // The last name of the user. Example: Doe
|
|
|
+ 'users.*.last_name' => 'string',
|
|
|
+ ]);
|
|
|
+
|
|
|
+ // Do stuff
|
|
|
+ }
|
|
|
+
|
|
|
+ public function withInlineRequestValidateFacadeWithFullImport()
|
|
|
+ {
|
|
|
+ // Some stuff
|
|
|
+ $validated = \Illuminate\Support\Facades\Request::validate([
|
|
|
+ // The id of the user. Example: 9
|
|
|
+ 'user_id' => 'int|required',
|
|
|
+ // The id of the room.
|
|
|
+ 'room_id' => ['string', 'in:3,5,6'],
|
|
|
+ // Whether to ban the user forever. Example: false
|
|
|
+ 'forever' => 'boolean',
|
|
|
+ // Just need something here. No-example
|
|
|
+ 'another_one' => 'numeric',
|
|
|
+ 'even_more_param' => 'array',
|
|
|
+ 'book.name' => 'string',
|
|
|
+ 'book.author_id' => 'integer',
|
|
|
+ 'book.pages_count' => 'integer',
|
|
|
+ 'ids.*' => 'integer',
|
|
|
+ // The first name of the user. Example: John
|
|
|
+ 'users.*.first_name' => ['string'],
|
|
|
+ // The last name of the user. Example: Doe
|
|
|
+ 'users.*.last_name' => 'string',
|
|
|
+ ]);
|
|
|
+
|
|
|
+ // Do stuff
|
|
|
+ }
|
|
|
+
|
|
|
+ public function withInlineRequestValidateWithBagFacade()
|
|
|
+ {
|
|
|
+ // Some stuff
|
|
|
+ $validated = Request::validateWithBag('stuff', [
|
|
|
+ // The id of the user. Example: 9
|
|
|
+ 'user_id' => 'int|required',
|
|
|
+ // The id of the room.
|
|
|
+ 'room_id' => ['string', 'in:3,5,6'],
|
|
|
+ // Whether to ban the user forever. Example: false
|
|
|
+ 'forever' => 'boolean',
|
|
|
+ // Just need something here. No-example
|
|
|
+ 'another_one' => 'numeric',
|
|
|
+ 'even_more_param' => 'array',
|
|
|
+ 'book.name' => 'string',
|
|
|
+ 'book.author_id' => 'integer',
|
|
|
+ 'book.pages_count' => 'integer',
|
|
|
+ 'ids.*' => 'integer',
|
|
|
+ // The first name of the user. Example: John
|
|
|
+ 'users.*.first_name' => ['string'],
|
|
|
+ // The last name of the user. Example: Doe
|
|
|
+ 'users.*.last_name' => 'string',
|
|
|
+ ]);
|
|
|
+
|
|
|
+ // Do stuff
|
|
|
+ }
|
|
|
+
|
|
|
public function withInlineValidatorMake(Request $request)
|
|
|
{
|
|
|
// Some stuff
|
|
@@ -585,7 +688,7 @@ class TestController extends Controller
|
|
|
{
|
|
|
return null;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public function withInjectedModelFullParamName(TestPost $testPost)
|
|
|
{
|
|
|
return null;
|