Skip to content

Commit 8d45380

Browse files
committed
refactor: simplify validation methods by removing unused className parameter
1 parent beabda9 commit 8d45380

File tree

1 file changed

+7
-16
lines changed

1 file changed

+7
-16
lines changed

src/stubs/validation.stub

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ final class {{ class }}
1212
* Validate if creation is allowed
1313
* @return bool
1414
*/
15-
public static function canCreate( array $args, ?string $className = __CLASS__ ): bool
15+
public static function canCreate( array $args ): bool
1616
{
17-
$validator = Validator::make($args, [
17+
$validator = Validator::make( $args, [
1818
// 'title' => 'required|string|max:191',
1919
]);
2020

21-
self::isFails( $validator, $className );
21+
self::isFails( $validator );
2222

2323
return true;
2424
}
@@ -27,24 +27,15 @@ final class {{ class }}
2727
* Validate if update is allowed
2828
* @return bool
2929
*/
30-
public static function canUpdate( array $args, ?string $className = __CLASS__ ): bool
30+
public static function canUpdate( array $args ): bool
3131
{
32-
$validator = Validator::make($args, [
33-
// 'id' => 'required|exists:users,id',
32+
$validator = Validator::make( $args, [
33+
// 'id' => 'required|exists:users,id',
3434
// 'title' => 'required|string|max:191',
3535
]);
3636

37-
self::isFails( $validator, $className );
37+
self::isFails( $validator );
3838

3939
return true;
4040
}
41-
42-
/**
43-
* Validate if delete is allowed
44-
* @return bool
45-
*/
46-
public static function canDelete( array $args, ?string $className = __CLASS__ ): bool
47-
{
48-
return true;
49-
}
5041
}

0 commit comments

Comments
 (0)