File tree 4 files changed +42
-11
lines changed
4 files changed +42
-11
lines changed Original file line number Diff line number Diff line change 1
1
name : Fix PHP code style issues
2
2
3
- on : [push]
3
+ on :
4
+ push :
5
+ paths :
6
+ - ' **.php'
4
7
5
8
jobs :
6
9
php-code-styling :
13
16
ref : ${{ github.head_ref }}
14
17
15
18
- name : Fix PHP code style issues
16
- uses : aglipanci/laravel-pint-action@1.0 .0
19
+ uses : aglipanci/laravel-pint-action@2.1 .0
17
20
18
21
- name : Commit changes
19
22
uses : stefanzweifel/git-auto-commit-action@v4
Original file line number Diff line number Diff line change 18
18
"require" : {
19
19
"php" : " ^8.1" ,
20
20
"bekwoh/laravel-contract" : " ^1.0" ,
21
- "illuminate/contracts" : " ^9.0" ,
22
- "spatie/laravel-package-tools" : " ^1.13 .0"
21
+ "illuminate/contracts" : " ^9.0|^10.0 " ,
22
+ "spatie/laravel-package-tools" : " ^1.14 .0"
23
23
},
24
24
"require-dev" : {
25
25
"laravel/pint" : " ^1.0" ,
26
- "nunomaduro/collision" : " ^6 .0" ,
26
+ "nunomaduro/collision" : " ^7 .0" ,
27
27
"nunomaduro/larastan" : " ^2.0.1" ,
28
- "orchestra/testbench" : " ^7 .0" ,
29
- "pestphp/pest" : " ^1.21 " ,
30
- "pestphp/pest-plugin-laravel" : " ^1.1 " ,
28
+ "orchestra/testbench" : " ^8 .0" ,
29
+ "pestphp/pest" : " ^2.0 " ,
30
+ "pestphp/pest-plugin-laravel" : " ^2.0 " ,
31
31
"phpstan/extension-installer" : " ^1.1" ,
32
32
"phpstan/phpstan-deprecation-rules" : " ^1.0" ,
33
33
"phpstan/phpstan-phpunit" : " ^1.0" ,
34
- "phpunit/phpunit" : " ^9.5"
34
+ "phpunit/phpunit" : " ^9.5 | ^10.0 "
35
35
},
36
36
"autoload" : {
37
37
"psr-4" : {
Original file line number Diff line number Diff line change @@ -129,7 +129,11 @@ protected function getModelNamespace()
129
129
130
130
public function throwExceptionIfMissingModel ()
131
131
{
132
- if (empty ($ this ->option ('model ' )) && ! $ this ->option ('menu ' ) && ! $ this ->option ('api ' )) {
132
+ if (! $ this ->option ('create-update ' )) {
133
+ return ;
134
+ }
135
+
136
+ if (empty ($ this ->option ('model ' ))) {
133
137
throw new RuntimeException ('Missing model option. ' );
134
138
}
135
139
}
Original file line number Diff line number Diff line change 8
8
$ this ->assertTrue (in_array ('make:action ' , $ commands ));
9
9
});
10
10
11
- it ('can make an action ' , function () {
11
+ it ('can make an action with model option ' , function () {
12
12
Artisan::call ('make:action CreateOrUpdateUser --model=User ' );
13
13
$ this ->assertTrue (
14
14
file_exists (base_path ('app/Actions/CreateOrUpdateUser.php ' ))
15
15
);
16
16
unlink (base_path ('app/Actions/CreateOrUpdateUser.php ' ));
17
17
});
18
+
19
+ it ('can make an action without model option ' , function () {
20
+ Artisan::call ('make:action CreateNewInvoice ' );
21
+ $ this ->assertTrue (
22
+ file_exists (base_path ('app/Actions/CreateNewInvoice.php ' ))
23
+ );
24
+ unlink (base_path ('app/Actions/CreateNewInvoice.php ' ));
25
+ });
26
+
27
+ it ('can make an API action ' , function () {
28
+ Artisan::call ('make:action StoreInvoiceDetails --api ' );
29
+ $ this ->assertTrue (
30
+ file_exists (base_path ('app/Actions/Api/StoreInvoiceDetails.php ' ))
31
+ );
32
+ unlink (base_path ('app/Actions/Api/StoreInvoiceDetails.php ' ));
33
+ });
34
+
35
+ it ('can make a menu action ' , function () {
36
+ Artisan::call ('make:action Sidebar --menu ' );
37
+ $ this ->assertTrue (
38
+ file_exists (base_path ('app/Actions/Builder/Menu/Sidebar.php ' ))
39
+ );
40
+ unlink (base_path ('app/Actions/Builder/Menu/Sidebar.php ' ));
41
+ });
You can’t perform that action at this time.
0 commit comments