Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone committed Aug 14, 2024
1 parent 7b07a07 commit e6cc6ff
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
7 changes: 7 additions & 0 deletions bin/sync
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Illuminate\Support\Collection::make([
Illuminate\Support\Collection::make([
...$files->glob("{$workingPath}/vendor/orchestra/testbench-core/workbench/config/*.php"),
...$files->glob("{$workingPath}/vendor/orchestra/testbench-core/workbench/config/*/*.php"),
...$files->glob("{$workingPath}/vendor/orchestra/testbench-core/workbench/database/factories/*.php"),
...$files->glob("{$workingPath}/vendor/orchestra/testbench-core/workbench/routes/*"),
...$files->glob("{$workingPath}/vendor/orchestra/testbench-core/workbench/resources/lang/en/*"),
...$files->glob("{$workingPath}/vendor/orchestra/testbench-core/workbench/resources/views/components/*"),
Expand All @@ -32,3 +33,9 @@ Illuminate\Support\Collection::make([
->each(function ($file) use ($files, $workingPath) {
$files->copy($file, "{$workingPath}/workbench".Illuminate\Support\Str::after($file, "{$workingPath}/vendor/orchestra/testbench-core/workbench"));
});

transform([
" - workbench/database/migrations" => " - vendor/orchestra/testbench-core/workbench/database/migrations",
], function ($changes) use ($files, $workingPath) {
$files->replaceInFile(array_keys($changes), array_values($changes), "{$workingPath}/testbench.yaml");
});
2 changes: 1 addition & 1 deletion testbench.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ env:
APP_NAME: "Testbench"

migrations:
- workbench/database/migrations
- vendor/orchestra/testbench-core/workbench/database/migrations

workbench:
discovers:
Expand Down
39 changes: 39 additions & 0 deletions workbench/database/factories/UserFactory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

namespace Workbench\Database\Factories;

use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;

class UserFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'name' => $this->faker->name(),
'email' => $this->faker->unique()->safeEmail(),
'email_verified_at' => now(),
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
'remember_token' => Str::random(10),
];
}

/**
* Indicate that the model's email address should be unverified.
*
* @return \Illuminate\Database\Eloquent\Factories\Factory
*/
public function unverified()
{
return $this->state(function (array $attributes) {
return [
'email_verified_at' => null,
];
});
}
}

0 comments on commit e6cc6ff

Please sign in to comment.