Skip to content

Commit 18684f4

Browse files
committed
bench
1 parent d3269c0 commit 18684f4

File tree

11 files changed

+253
-0
lines changed

11 files changed

+253
-0
lines changed

workbench/app/Models/.gitkeep

Whitespace-only changes.

workbench/app/Models/User.php

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?php
2+
3+
namespace Workbench\App\Models;
4+
5+
// use Illuminate\Contracts\Auth\MustVerifyEmail;
6+
use Illuminate\Database\Eloquent\Factories\HasFactory;
7+
use Illuminate\Foundation\Auth\User as Authenticatable;
8+
use Illuminate\Notifications\Notifiable;
9+
10+
class User extends Authenticatable
11+
{
12+
use HasFactory, Notifiable;
13+
14+
/**
15+
* The attributes that are mass assignable.
16+
*
17+
* @var array<int, string>
18+
*/
19+
protected $fillable = [
20+
'name',
21+
'email',
22+
'password',
23+
];
24+
25+
/**
26+
* The attributes that should be hidden for serialization.
27+
*
28+
* @var array<int, string>
29+
*/
30+
protected $hidden = [
31+
'password',
32+
'remember_token',
33+
];
34+
35+
/**
36+
* The attributes that should be cast.
37+
*
38+
* @var array<string, string>
39+
*/
40+
protected $casts = [
41+
'email_verified_at' => 'datetime',
42+
'password' => 'hashed',
43+
];
44+
}

workbench/bootstrap/app.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
use Illuminate\Foundation\Application;
4+
use Illuminate\Foundation\Configuration\Exceptions;
5+
use Illuminate\Foundation\Configuration\Middleware;
6+
7+
use function Orchestra\Testbench\default_skeleton_path;
8+
9+
return Application::configure(basePath: $APP_BASE_PATH ?? default_skeleton_path())
10+
->withRouting(
11+
web: __DIR__.'/../routes/web.php',
12+
commands: __DIR__.'/../routes/console.php',
13+
)
14+
->withMiddleware(function (Middleware $middleware) {
15+
//
16+
})
17+
->withExceptions(function (Exceptions $exceptions) {
18+
//
19+
})->create();

workbench/database/factories/.gitkeep

Whitespace-only changes.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?php
2+
3+
namespace Workbench\Database\Factories;
4+
5+
use Illuminate\Database\Eloquent\Factories\Factory;
6+
use Illuminate\Support\Facades\Hash;
7+
use Illuminate\Support\Str;
8+
use Workbench\App\Models\User;
9+
10+
/**
11+
* @template TModel of \Workbench\App\Models\User
12+
*
13+
* @extends \Illuminate\Database\Eloquent\Factories\Factory<TModel>
14+
*/
15+
class UserFactory extends Factory
16+
{
17+
/**
18+
* The current password being used by the factory.
19+
*/
20+
protected static ?string $password;
21+
22+
/**
23+
* The name of the factory's corresponding model.
24+
*
25+
* @var class-string<TModel>
26+
*/
27+
protected $model = User::class;
28+
29+
/**
30+
* Define the model's default state.
31+
*
32+
* @return array<string, mixed>
33+
*/
34+
public function definition(): array
35+
{
36+
return [
37+
'name' => fake()->name(),
38+
'email' => fake()->unique()->safeEmail(),
39+
'email_verified_at' => now(),
40+
'password' => static::$password ??= Hash::make('password'),
41+
'remember_token' => Str::random(10),
42+
];
43+
}
44+
45+
/**
46+
* Indicate that the model's email address should be unverified.
47+
*/
48+
public function unverified(): static
49+
{
50+
return $this->state(fn (array $attributes) => [
51+
'email_verified_at' => null,
52+
]);
53+
}
54+
}

workbench/database/migrations/.gitkeep

Whitespace-only changes.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
namespace Workbench\Database\Seeders;
4+
5+
use Illuminate\Database\Seeder;
6+
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
7+
use Workbench\Database\Factories\UserFactory;
8+
9+
class DatabaseSeeder extends Seeder
10+
{
11+
/**
12+
* Seed the application's database.
13+
*/
14+
public function run(): void
15+
{
16+
// UserFactory::new()->times(10)->create();
17+
18+
UserFactory::new()->create([
19+
'name' => 'Test User',
20+
'email' => '[email protected]',
21+
]);
22+
}
23+
}

workbench/resources/views/.gitkeep

Whitespace-only changes.
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="utf-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
<script src="https://cdn.tailwindcss.com"></script>
8+
9+
<script defer src="https://cdn.jsdelivr.net/npm/@alpinejs/[email protected]/dist/cdn.min.js"></script>
10+
<script defer src="https://cdn.jsdelivr.net/npm/@alpinejs/[email protected]/dist/cdn.min.js"></script>
11+
<script defer src="https://cdn.jsdelivr.net/npm/@alpinejs/[email protected]/dist/cdn.min.js"></script>
12+
13+
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/cdn.min.js"></script>
14+
15+
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/iconify-icon.min.js"></script>
16+
</head>
17+
18+
<body class="">
19+
20+
<div class="grid grid-cols-3 divide-x [&>*]:h-60">
21+
22+
<div class="flex items-center justify-center border-b">
23+
<x-kit::button color="white">
24+
Button
25+
</x-kit::button>
26+
</div>
27+
<x-kit::popover class="flex flex-col items-center justify-center gap-1 border-b" x-data="{
28+
value: 'Initial',
29+
}">
30+
<x-kit::button color="white" class="!min-w-40 rounded-md" x-ref="trigger" x-on:click="open = !open">
31+
<span x-text="value"></span>
32+
<x-slot:icon-right class="ml-auto">
33+
<iconify-icon icon="heroicons:chevron-up-down"></iconify-icon>
34+
</x-slot:icon-right>
35+
</x-kit::button>
36+
37+
<x-kit::popover.content x-transition.origin.top=""
38+
class="flex min-w-40 flex-col rounded-md border bg-white shadow-lg">
39+
<div>
40+
<x-kit::input autofocus size="sm" color="white" class="rounded-t-md border-b"
41+
class-input="!ring-0" placeholder="Search">
42+
<x-slot:icon class="text-black/40">
43+
<iconify-icon icon="heroicons:magnifying-glass"></iconify-icon>
44+
</x-slot:icon>
45+
</x-kit::input>
46+
</div>
47+
<div class="flex flex-col gap-0.5 p-1">
48+
<x-kit::button.radio color-checked="black" x-model="value" name="listbox" value="Initial"
49+
class="w-full rounded hover:bg-gray-100" size="sm">
50+
Initial
51+
<x-slot:icon-right class="ml-auto hidden peer-checked/input:block">
52+
<iconify-icon icon="heroicons:check"></iconify-icon>
53+
</x-slot:icon-right>
54+
</x-kit::button.radio>
55+
<x-kit::button.radio color-checked="black" x-model="value" name="listbox" value="Option 1"
56+
class="w-full rounded hover:bg-gray-100" size="sm">
57+
Option 1
58+
<x-slot:icon-right class="ml-auto hidden peer-checked/input:block">
59+
<iconify-icon icon="heroicons:check"></iconify-icon>
60+
</x-slot:icon-right>
61+
</x-kit::button.radio>
62+
<x-kit::button.radio color-checked="black" x-model="value" name="listbox" value="Option 2"
63+
class="w-full rounded hover:bg-gray-100" size="sm">
64+
Option 2
65+
<x-slot:icon-right class="ml-auto hidden peer-checked/input:block">
66+
<iconify-icon icon="heroicons:check"></iconify-icon>
67+
</x-slot:icon-right>
68+
</x-kit::button.radio>
69+
</div>
70+
</x-kit::popover.content>
71+
</x-kit::popover>
72+
<div class="flex items-center justify-center border-b">
73+
<x-kit::tag color="white">
74+
Tag
75+
</x-kit::tag>
76+
</div>
77+
<div class="flex items-center justify-center border-b">
78+
<x-kit::select color="white">
79+
<option>
80+
Option 1
81+
</option>
82+
</x-kit::select>
83+
</div>
84+
<div class="flex items-center justify-center border-b">
85+
<x-kit::switch color="white">
86+
Switch
87+
</x-kit::switch>
88+
</div>
89+
<div class="flex items-center justify-center border-b">
90+
<x-kit::button color="white">
91+
Button
92+
</x-kit::button>
93+
</div>
94+
95+
</div>
96+
</body>
97+
98+
</html>

workbench/routes/console.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
use Illuminate\Foundation\Inspiring;
4+
use Illuminate\Support\Facades\Artisan;
5+
6+
Artisan::command('inspire', function () {
7+
$this->comment(Inspiring::quote());
8+
})->purpose('Display an inspiring quote')->hourly();

0 commit comments

Comments
 (0)