Skip to content

Commit da3ec28

Browse files
committed
wip
1 parent e22e114 commit da3ec28

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

config/laravel-playwright.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,12 @@
124124
* ]
125125
*/
126126

127+
/**
128+
* Used to tell the package you want a model created, either from the passed FQCN or
129+
* from the model_alias as defined below.
130+
*/
131+
'model_designator' => 'model.',
132+
127133
/**
128134
* Used to separate the model from any other passed options.
129135
*/

src/Http/Controllers/LaravelPlaywrightController.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ public function login(Request $request)
169169
});
170170
}
171171

172+
/**
173+
* @throws Throwable
174+
*/
172175
protected function userClassName(Request $request)
173176
{
174177
if ($request->has('userModel')) {
@@ -274,9 +277,9 @@ protected function resolveStateAttributes($state): array
274277
$paramSeparator,
275278
) {
276279
if (
277-
! is_string($attribute)
278-
|| ! str_contains($attribute, $modelDesignator)
279-
|| (! str_contains($attribute, '(') && ! str_contains($attribute, ')'))
280+
! (is_string($attribute)
281+
&& (str_contains($attribute, $modelDesignator)
282+
|| (str_contains($attribute, '(') && str_contains($attribute, ')'))))
280283
) {
281284
return $attribute;
282285
}

0 commit comments

Comments
 (0)