File tree Expand file tree Collapse file tree 4 files changed +33
-3
lines changed
Expand file tree Collapse file tree 4 files changed +33
-3
lines changed Original file line number Diff line number Diff line change 1717 node-version : [ "20.x" ]
1818
1919 steps :
20- - uses : actions/checkout@v2
20+ - uses : actions/checkout@v4
2121
2222 - name : Setup PHP
2323 uses : shivammathur/setup-php@v2
2626
2727 - name : Cache Composer packages
2828 id : composer-cache
29- uses : actions/cache@v2
29+ uses : actions/cache@v4
3030 with :
3131 path : vendor
3232 key : ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
Original file line number Diff line number Diff line change 4141
4242 steps :
4343 - name : Checkout Repository
44- uses : actions/checkout@v3
44+ uses : actions/checkout@v4
4545
4646 - name : Setup PHP for Current Version
4747 uses : shivammathur/setup-php@v2
Original file line number Diff line number Diff line change @@ -18,6 +18,13 @@ public function __construct(string $path)
1818 $ this ->app ->make ('Illuminate\Contracts\Console\Kernel ' )->bootstrap ();
1919 }
2020
21+ public function init (): void
22+ {
23+ parent ::init ();
24+
25+ $ this ->bootAliases ();
26+ }
27+
2128 public function name (): string
2229 {
2330 return 'Laravel ' ;
@@ -50,4 +57,22 @@ public function casters(): array
5057
5158 return $ casters ;
5259 }
60+
61+ private function bootAliases (): void
62+ {
63+ if (! class_exists (\Laravel \Tinker \ClassAliasAutoloader::class)) {
64+ return ;
65+ }
66+
67+ $ config = $ this ->app ->make ('config ' );
68+
69+ $ path = \Illuminate \Support \Env::get ('COMPOSER_VENDOR_DIR ' , $ this ->app ->basePath ().DIRECTORY_SEPARATOR .'vendor ' );
70+
71+ \Laravel \Tinker \ClassAliasAutoloader::register (
72+ $ this ->tinker ->getShell (),
73+ $ path .'/composer/autoload_classmap.php ' ,
74+ $ config ->get ('tinker.alias ' , []),
75+ $ config ->get ('tinker.dont_alias ' , [])
76+ );
77+ }
5378}
Original file line number Diff line number Diff line change @@ -85,4 +85,9 @@ protected function cleanOutput(string $output): string
8585
8686 return trim ($ output );
8787 }
88+
89+ public function getShell (): Shell
90+ {
91+ return $ this ->shell ;
92+ }
8893}
You can’t perform that action at this time.
0 commit comments