generated from spatie/package-skeleton-laravel
-
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.
- Loading branch information
1 parent
c6ccb45
commit 67580b5
Showing
13 changed files
with
228 additions
and
15 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
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
Empty file.
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,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', | ||
]; | ||
} |
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,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 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 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 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(10)->create(); | ||
|
||
UserFactory::new()->create([ | ||
'name' => 'Test User', | ||
'email' => '[email protected]', | ||
]); | ||
} | ||
} |
Empty file.
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,8 @@ | ||
<?php | ||
|
||
use Illuminate\Foundation\Inspiring; | ||
use Illuminate\Support\Facades\Artisan; | ||
|
||
Artisan::command('inspire', function () { | ||
$this->comment(Inspiring::quote()); | ||
})->purpose('Display an inspiring quote')->hourly(); |
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,7 @@ | ||
<?php | ||
|
||
use Illuminate\Support\Facades\Route; | ||
|
||
Route::get('/', function () { | ||
return view('welcome'); | ||
}); |