Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone committed Oct 15, 2023
1 parent 58bfabf commit 2488d44
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
16 changes: 16 additions & 0 deletions bin/sync
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,20 @@ Illuminate\Support\Collection::make([
$files->copy($file, "{$workingPath}/src/Console/stubs".Illuminate\Support\Str::after($file, "{$workingPath}/skeleton"));
});

transform([
'Route::middleware(\'auth:sanctum\')->get(\'/user\', function (Request $request) {
return $request->user();
});'.PHP_EOL => '// Route::middleware(\'auth:sanctum\')->get(\'/user\', function (Request $request) {
// return $request->user();
// });'.PHP_EOL,
], fn ($changes) => $files->replaceInFile(array_keys($changes), array_values($changes), "{$workingPath}/src/Console/stubs/routes/api.php"));

transform([
'Artisan::command(\'inspire\', function () {
$this->comment(Inspiring::quote());
})->purpose(\'Display an inspiring quote\');'.PHP_EOL => '// Artisan::command(\'inspire\', function () {
// $this->comment(Inspiring::quote());
// })->purpose(\'Display an inspiring quote\');'.PHP_EOL,
], fn ($changes) => $files->replaceInFile(array_keys($changes), array_values($changes), "{$workingPath}/src/Console/stubs/routes/console.php"));

$files->deleteDirectory("{$workingPath}/skeleton");
6 changes: 3 additions & 3 deletions src/Console/stubs/routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
|
*/

Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
return $request->user();
});
// Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
// return $request->user();
// });
6 changes: 3 additions & 3 deletions src/Console/stubs/routes/console.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
|
*/

Artisan::command('inspire', function () {
$this->comment(Inspiring::quote());
})->purpose('Display an inspiring quote');
// Artisan::command('inspire', function () {
// $this->comment(Inspiring::quote());
// })->purpose('Display an inspiring quote');

0 comments on commit 2488d44

Please sign in to comment.