-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature(SK): Optional usage of the playground via an install command
This is better than forcing routes on those who use this to use the playground you can use `sidekick::install'
- Loading branch information
1 parent
1a00d58
commit e3770c5
Showing
15 changed files
with
89 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
|
||
namespace PapaRascalDev\Sidekick\Console; | ||
|
||
use Illuminate\Console\Command; | ||
use Illuminate\Filesystem\Filesystem; | ||
use Symfony\Component\Console\Attribute\AsCommand; | ||
|
||
#[AsCommand(name: 'sidekick:install', description: 'Install Sidekick Playground')] | ||
class InstallCommand extends Command | ||
{ | ||
/** | ||
* The name and signature of the console command. | ||
* | ||
* @var string | ||
*/ | ||
protected $signature = 'sidekick:install'; | ||
|
||
/** | ||
* The console command description. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = 'Install Sidekick Playground'; | ||
|
||
/** | ||
* Execute the console command. | ||
* | ||
* @return int|null | ||
*/ | ||
public function handle() | ||
{ | ||
$fileSystem = new Filesystem(); | ||
// Install resources | ||
$fileSystem->ensureDirectoryExists(resource_path('views')); | ||
$fileSystem->copyDirectory(__DIR__.'/../../stubs/default/resources/views', resource_path('views')); | ||
|
||
// Install Routes | ||
$fileSystem->ensureDirectoryExists(base_path('routes')); | ||
$fileSystem->copyDirectory(__DIR__.'/../../stubs/default/routes', base_path('routes')); | ||
|
||
// Make link to routes in web.php | ||
$webRoutesPath = base_path('routes/web.php'); | ||
$routeLink = "\nrequire base_path('routes/web.sidekick.php');\n"; | ||
$fileSystem->append($webRoutesPath, $routeLink); | ||
|
||
$this->components->success("Successfully installed Sidekick Playground"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
resources/views/Blade/Pages/audio.blade.php → ...ult/resources/views/Pages/audio.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
@extends('sidekick::Blade.Shared.layout') | ||
@extends('Shared.layout') | ||
|
||
@section('title') | ||
Audio Generation Sample | ||
|
2 changes: 1 addition & 1 deletion
2
resources/views/Blade/Pages/chat.blade.php → ...ault/resources/views/Pages/chat.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
@extends('sidekick::Blade.Shared.layout') | ||
@extends('Shared.layout') | ||
|
||
@section('title') | ||
Talk to Sidekick! | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...es/views/Blade/Pages/completion.blade.php → ...esources/views/Pages/completion.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
@extends('sidekick::Blade.Shared.layout') | ||
@extends('Shared.layout') | ||
|
||
@section('title') | ||
Completion Sample | ||
|
2 changes: 1 addition & 1 deletion
2
...ces/views/Blade/Pages/embedding.blade.php → ...resources/views/Pages/embedding.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
resources/views/Blade/Pages/image.blade.php → ...ult/resources/views/Pages/image.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
@extends('sidekick::Blade.Shared.layout') | ||
@extends('Shared.layout') | ||
|
||
@section('title') | ||
Image Generation Sample | ||
|
2 changes: 1 addition & 1 deletion
2
resources/views/Blade/Pages/index.blade.php → ...ult/resources/views/Pages/index.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...rces/views/Blade/Pages/moderate.blade.php → .../resources/views/Pages/moderate.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
@extends('sidekick::Blade.Shared.layout') | ||
@extends('Shared.layout') | ||
|
||
@section('title') | ||
Moderate Sample | ||
|
2 changes: 1 addition & 1 deletion
2
...es/views/Blade/Pages/transcribe.blade.php → ...esources/views/Pages/transcribe.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters