diff --git a/composer.json b/composer.json index f87b4b0c0..60fe7a438 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ "require": { "php": "^7.3", "ext-json": "*", - "laravel/framework": "^8.0", + "laravel/framework": "^8.2", "symfony/var-dumper": "^5.0" }, "require-dev": { @@ -25,7 +25,8 @@ }, "autoload": { "psr-4": { - "Laravel\\Telescope\\": "src/" + "Laravel\\Telescope\\": "src/", + "Laravel\\Telescope\\Database\\Factories\\": "database/factories/" } }, "autoload-dev": { diff --git a/tests/EntryModelFactory.php b/database/factories/EntryModelFactory.php similarity index 95% rename from tests/EntryModelFactory.php rename to database/factories/EntryModelFactory.php index f34cff6fd..af6bd3eef 100644 --- a/tests/EntryModelFactory.php +++ b/database/factories/EntryModelFactory.php @@ -1,6 +1,6 @@ define(EntryModel::class, function (Faker\Generator $faker) { - return [ - 'sequence' => random_int(1, 10000), - 'uuid' => $faker->uuid, - 'batch_id' => $faker->uuid, - 'type' => $faker->randomElement([ - EntryType::CACHE, EntryType::COMMAND, EntryType::DUMP, EntryType::EVENT, EntryType::EXCEPTION, - EntryType::JOB, EntryType::LOG, EntryType::MAIL, EntryType::MODEL, EntryType::NOTIFICATION, - EntryType::QUERY, EntryType::REDIS, EntryType::REQUEST, EntryType::SCHEDULED_TASK, - ]), - 'content' => [$faker->word => $faker->word], - ]; -}); diff --git a/src/TelescopeServiceProvider.php b/src/TelescopeServiceProvider.php index 6da7be523..89f65fb84 100644 --- a/src/TelescopeServiceProvider.php +++ b/src/TelescopeServiceProvider.php @@ -71,7 +71,7 @@ private function routeConfiguration() private function registerMigrations() { if ($this->app->runningInConsole() && $this->shouldMigrate()) { - $this->loadMigrationsFrom(__DIR__.'/Storage/migrations'); + $this->loadMigrationsFrom(__DIR__.'/../database/migrations'); } } diff --git a/tests/Console/ClearCommandTest.php b/tests/Console/ClearCommandTest.php index fa244aa94..ea5509d63 100644 --- a/tests/Console/ClearCommandTest.php +++ b/tests/Console/ClearCommandTest.php @@ -3,8 +3,8 @@ namespace Laravel\Telescope\Tests\Console; use Illuminate\Support\Facades\DB; +use Laravel\Telescope\Database\Factories\EntryModelFactory; use Laravel\Telescope\Storage\EntryModel; -use Laravel\Telescope\Tests\EntryModelFactory; use Laravel\Telescope\Tests\FeatureTestCase; class ClearCommandTest extends FeatureTestCase diff --git a/tests/Console/PruneCommandTest.php b/tests/Console/PruneCommandTest.php index 4b7aa7f57..ccf4b4243 100644 --- a/tests/Console/PruneCommandTest.php +++ b/tests/Console/PruneCommandTest.php @@ -2,7 +2,7 @@ namespace Laravel\Telescope\Tests\Console; -use Laravel\Telescope\Tests\EntryModelFactory; +use Laravel\Telescope\Database\Factories\EntryModelFactory; use Laravel\Telescope\Tests\FeatureTestCase; class PruneCommandTest extends FeatureTestCase diff --git a/tests/Http/RouteTest.php b/tests/Http/RouteTest.php index f238d519b..39e4dcde1 100644 --- a/tests/Http/RouteTest.php +++ b/tests/Http/RouteTest.php @@ -5,9 +5,9 @@ use Illuminate\Foundation\Application; use Illuminate\Foundation\Testing\TestResponse as LegacyTestResponse; use Illuminate\Testing\TestResponse; +use Laravel\Telescope\Database\Factories\EntryModelFactory; use Laravel\Telescope\EntryType; use Laravel\Telescope\Http\Middleware\Authorize; -use Laravel\Telescope\Tests\EntryModelFactory; use Laravel\Telescope\Tests\FeatureTestCase; use Orchestra\Testbench\Http\Middleware\VerifyCsrfToken; use PHPUnit\Framework\Assert as PHPUnit; diff --git a/tests/Storage/DatabaseEntriesRepositoryTest.php b/tests/Storage/DatabaseEntriesRepositoryTest.php index ca54175b8..eda853844 100644 --- a/tests/Storage/DatabaseEntriesRepositoryTest.php +++ b/tests/Storage/DatabaseEntriesRepositoryTest.php @@ -2,8 +2,8 @@ namespace Laravel\Telescope\Tests\Storage; +use Laravel\Telescope\Database\Factories\EntryModelFactory; use Laravel\Telescope\Storage\DatabaseEntriesRepository; -use Laravel\Telescope\Tests\EntryModelFactory; use Laravel\Telescope\Tests\FeatureTestCase; class DatabaseEntriesRepositoryTest extends FeatureTestCase diff --git a/tests/Telescope/ExtractTagTest.php b/tests/Telescope/ExtractTagTest.php index 7273a76d6..9b5ab6f41 100644 --- a/tests/Telescope/ExtractTagTest.php +++ b/tests/Telescope/ExtractTagTest.php @@ -3,9 +3,9 @@ namespace Laravel\Telescope\Tests\Telescope; use Illuminate\Mail\Mailable; +use Laravel\Telescope\Database\Factories\EntryModelFactory; use Laravel\Telescope\ExtractTags; use Laravel\Telescope\FormatModel; -use Laravel\Telescope\Tests\EntryModelFactory; use Laravel\Telescope\Tests\FeatureTestCase; class ExtractTagTest extends FeatureTestCase