Skip to content

Commit

Permalink
install workbench
Browse files Browse the repository at this point in the history
  • Loading branch information
Kim-the-Diamond committed Sep 19, 2024
1 parent 8fe7d3c commit c1414bd
Show file tree
Hide file tree
Showing 22 changed files with 238 additions and 24 deletions.
29 changes: 28 additions & 1 deletion packages/builder/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,32 @@
}
},
"minimum-stability": "stable",
"prefer-stable": true
"prefer-stable": true,
"require-dev": {
"orchestra/workbench": "^9.6"
},
"autoload-dev": {
"psr-4": {
"Workbench\\App\\": "workbench/app/",
"Workbench\\Database\\Factories\\": "workbench/database/factories/",
"Workbench\\Database\\Seeders\\": "workbench/database/seeders/"
}
},
"scripts": {
"post-autoload-dump": [
"@clear",
"@prepare"
],
"clear": "@php vendor/bin/testbench package:purge-skeleton --ansi",
"prepare": "@php vendor/bin/testbench package:discover --ansi",
"build": "@php vendor/bin/testbench workbench:build --ansi",
"serve": [
"Composer\\Config::disableProcessTimeout",
"@build",
"@php vendor/bin/testbench serve --ansi"
],
"lint": [
"@php vendor/bin/phpstan analyse --verbose --ansi"
]
}
}
2 changes: 2 additions & 0 deletions packages/builder/workbench/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.env
.env.dusk
Empty file.
45 changes: 45 additions & 0 deletions packages/builder/workbench/app/Models/User.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?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;
use Laravel\Sanctum\HasApiTokens;

class User extends Authenticatable
{
use HasFactory, Notifiable;

/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'name',
'email',
'password',
];

/**
* The attributes that should be hidden for serialization.
*
* @var array<int, string>
*/
protected $hidden = [
'password',
'remember_token',
];

/**
* The attributes that should be cast.
*
* @var array<string, string>
*/
protected $casts = [
'email_verified_at' => 'datetime',
'password' => 'hashed',
];
}
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
{
//
}
}
19 changes: 19 additions & 0 deletions packages/builder/workbench/bootstrap/app.php
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();
5 changes: 5 additions & 0 deletions packages/builder/workbench/bootstrap/providers.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

return [
//
];
Empty file.
54 changes: 54 additions & 0 deletions packages/builder/workbench/database/factories/UserFactory.php
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.
23 changes: 23 additions & 0 deletions packages/builder/workbench/database/seeders/DatabaseSeeder.php
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(10)->create();

UserFactory::new()->create([
'name' => 'Test User',
'email' => 'test@example.com',
]);
}
}
Empty file.
8 changes: 8 additions & 0 deletions packages/builder/workbench/routes/console.php
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());

Check failure on line 7 in packages/builder/workbench/routes/console.php

View workflow job for this annotation

GitHub Actions / phpstan

Undefined variable: $this
})->purpose('Display an inspiring quote')->hourly();
7 changes: 7 additions & 0 deletions packages/builder/workbench/routes/web.php
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');
});
2 changes: 1 addition & 1 deletion public/css/filament/filament/app.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/css/filament/forms/forms.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/js/filament/forms/components/date-time-picker.js

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions public/js/filament/forms/components/file-upload.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/js/filament/forms/components/markdown-editor.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions public/js/filament/forms/components/rich-editor.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions public/js/filament/support/support.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions public/js/filament/widgets/components/chart.js

Large diffs are not rendered by default.

0 comments on commit c1414bd

Please sign in to comment.