-
Notifications
You must be signed in to change notification settings - Fork 4
Setup orchestra/testbench Workbench for local package development #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7e37f01
Initial plan
Copilot 2553e09
Initial assessment: setting up testbench workbench for local development
Copilot 79dd17a
Complete workbench setup with composer serve functionality
Copilot d5d48a6
Setup orchestra/testbench Workbench for local package development
Copilot 3f279c4
Address feedback: remove build artifacts from git, add service provid…
Copilot c498d27
Remove .phpunit.result.cache file from git history
Copilot 32097b9
Remove build/logs/clover.xml from git tracking
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,7 +1,7 @@ | ||
| <?php | ||
|
|
||
| /** | ||
| * Here is the serverless function entry | ||
| * for deployment with Vercel. | ||
| */ | ||
| * Here is the serverless function entry | ||
| * for deployment with Vercel. | ||
| */ | ||
| require __DIR__.'/../public/index.php'; |
This file contains hidden or 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,37 @@ | ||
| laravel: '@testbench' | ||
|
|
||
| providers: | ||
| # - Workbench\App\Providers\WorkbenchServiceProvider | ||
| - Revolution\Ordering\Providers\OrderingServiceProvider | ||
|
|
||
| migrations: | ||
| - workbench/database/migrations | ||
|
|
||
| seeders: | ||
| - Workbench\Database\Seeders\DatabaseSeeder | ||
|
|
||
| workbench: | ||
| start: '/' | ||
| install: true | ||
| health: false | ||
| discovers: | ||
| web: true | ||
| api: true | ||
| commands: true | ||
| components: false | ||
| factories: true | ||
| views: false | ||
| build: | ||
| - asset-publish | ||
| - create-sqlite-db | ||
| - db-wipe | ||
| - migrate-fresh | ||
| assets: | ||
| - laravel-assets | ||
| sync: | ||
|
kawax marked this conversation as resolved.
|
||
| - from: storage | ||
| to: workbench/storage | ||
| reverse: true | ||
| - from: public/build | ||
| to: workbench/public/build | ||
| reverse: true | ||
Empty file.
This file contains hidden or 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,48 @@ | ||
| <?php | ||
|
|
||
| namespace Workbench\App\Models; | ||
|
|
||
| // use Illuminate\Contracts\Auth\MustVerifyEmail; | ||
| use Illuminate\Database\Eloquent\Factories\HasFactory; | ||
| use Illuminate\Foundation\Auth\User as Authenticatable; | ||
| use Illuminate\Notifications\Notifiable; | ||
|
|
||
| class User extends Authenticatable | ||
| { | ||
| /** @use HasFactory<\Workbench\Database\Factories\UserFactory> */ | ||
| use HasFactory, Notifiable; | ||
|
|
||
| /** | ||
| * The attributes that are mass assignable. | ||
| * | ||
| * @var list<string> | ||
| */ | ||
| protected $fillable = [ | ||
| 'name', | ||
| 'email', | ||
| 'password', | ||
| ]; | ||
|
|
||
| /** | ||
| * The attributes that should be hidden for serialization. | ||
| * | ||
| * @var list<string> | ||
| */ | ||
| protected $hidden = [ | ||
| 'password', | ||
| 'remember_token', | ||
| ]; | ||
|
|
||
| /** | ||
| * Get the attributes that should be cast. | ||
| * | ||
| * @return array<string, string> | ||
| */ | ||
| protected function casts(): array | ||
| { | ||
| return [ | ||
| 'email_verified_at' => 'datetime', | ||
| 'password' => 'hashed', | ||
| ]; | ||
| } | ||
| } |
This file contains hidden or 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,24 @@ | ||
| <?php | ||
|
|
||
| namespace Workbench\App\Providers; | ||
|
|
||
| use Illuminate\Support\ServiceProvider; | ||
|
|
||
| class WorkbenchServiceProvider extends ServiceProvider | ||
| { | ||
| /** | ||
| * Register services. | ||
| */ | ||
| public function register(): void | ||
| { | ||
| // | ||
| } | ||
|
|
||
| /** | ||
| * Bootstrap services. | ||
| */ | ||
| public function boot(): void | ||
| { | ||
| // | ||
| } | ||
| } |
This file contains hidden or 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,19 @@ | ||
| <?php | ||
|
|
||
| use Illuminate\Foundation\Application; | ||
| use Illuminate\Foundation\Configuration\Exceptions; | ||
| use Illuminate\Foundation\Configuration\Middleware; | ||
|
|
||
| use function Orchestra\Testbench\default_skeleton_path; | ||
|
|
||
| return Application::configure(basePath: $APP_BASE_PATH ?? default_skeleton_path()) | ||
| ->withRouting( | ||
| web: __DIR__.'/../routes/web.php', | ||
| commands: __DIR__.'/../routes/console.php', | ||
| ) | ||
| ->withMiddleware(function (Middleware $middleware) { | ||
| // | ||
| }) | ||
| ->withExceptions(function (Exceptions $exceptions) { | ||
| // | ||
| })->create(); |
Empty file.
This file contains hidden or 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,54 @@ | ||
| <?php | ||
|
|
||
| namespace Workbench\Database\Factories; | ||
|
|
||
| use Illuminate\Database\Eloquent\Factories\Factory; | ||
| use Illuminate\Support\Facades\Hash; | ||
| use Illuminate\Support\Str; | ||
| use Workbench\App\Models\User; | ||
|
|
||
| /** | ||
| * @template TModel of \Workbench\App\Models\User | ||
| * | ||
| * @extends \Illuminate\Database\Eloquent\Factories\Factory<TModel> | ||
| */ | ||
| class UserFactory extends Factory | ||
| { | ||
| /** | ||
| * The current password being used by the factory. | ||
| */ | ||
| protected static ?string $password; | ||
|
|
||
| /** | ||
| * The name of the factory's corresponding model. | ||
| * | ||
| * @var class-string<TModel> | ||
| */ | ||
| protected $model = User::class; | ||
|
|
||
| /** | ||
| * Define the model's default state. | ||
| * | ||
| * @return array<string, mixed> | ||
| */ | ||
| public function definition(): array | ||
| { | ||
| return [ | ||
| 'name' => fake()->name(), | ||
| 'email' => fake()->unique()->safeEmail(), | ||
| 'email_verified_at' => now(), | ||
| 'password' => static::$password ??= Hash::make('password'), | ||
| 'remember_token' => Str::random(10), | ||
| ]; | ||
| } | ||
|
|
||
| /** | ||
| * Indicate that the model's email address should be unverified. | ||
| */ | ||
| public function unverified(): static | ||
| { | ||
| return $this->state(fn (array $attributes) => [ | ||
| 'email_verified_at' => null, | ||
| ]); | ||
| } | ||
| } |
Empty file.
This file contains hidden or 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,23 @@ | ||
| <?php | ||
|
|
||
| namespace Workbench\Database\Seeders; | ||
|
|
||
| use Illuminate\Database\Seeder; | ||
| // use Illuminate\Database\Console\Seeds\WithoutModelEvents; | ||
| use Workbench\Database\Factories\UserFactory; | ||
|
|
||
| class DatabaseSeeder extends Seeder | ||
| { | ||
| /** | ||
| * Seed the application's database. | ||
| */ | ||
| public function run(): void | ||
| { | ||
| // UserFactory::new()->times(10)->create(); | ||
|
|
||
| UserFactory::new()->create([ | ||
| 'name' => 'Test User', | ||
| 'email' => 'test@example.com', | ||
| ]); | ||
| } | ||
| } |
Empty file.
This file contains hidden or 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,8 @@ | ||
| <?php | ||
|
|
||
| use Illuminate\Foundation\Inspiring; | ||
| use Illuminate\Support\Facades\Artisan; | ||
|
|
||
| // Artisan::command('inspire', function () { | ||
| // $this->comment(Inspiring::quote()); | ||
| // })->purpose('Display an inspiring quote'); |
This file contains hidden or 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,7 @@ | ||
| <?php | ||
|
|
||
| use Illuminate\Support\Facades\Route; | ||
|
|
||
| Route::get('/', function () { | ||
| return view('welcome'); | ||
| }); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.