From 67f3c3cc3c11208208ad2b75a2b07ed3e7eacd08 Mon Sep 17 00:00:00 2001 From: Anastas Mironov Date: Mon, 3 Jul 2023 18:08:48 +0600 Subject: [PATCH] feat: configure documents --- .github/ISSUE_TEMPLATE/config.yml | 6 +- CHANGELOG.md | 2 +- LICENSE.md | 2 +- README.md | 37 +-- composer.json | 24 +- config/admin-kit-documents.php | 6 + config/skeleton.php | 6 - configure.php | 271 ------------------ database/factories/DocumentFactory.php | 18 ++ database/factories/SingleNameFactory.php | 18 -- ...create_admin_kit_documents_table.php.stub} | 4 +- phpunit.xml.dist | 2 +- ...leton_without_prefix.php => documents.php} | 4 +- ...leton_without_prefix.php => documents.php} | 4 +- ...eletonCommand.php => DocumentsCommand.php} | 6 +- src/Documents.php | 7 + ...vider.php => DocumentsServiceProvider.php} | 16 +- src/Facades/Documents.php | 16 ++ src/Facades/Skeleton.php | 16 -- src/Models/{SingleName.php => Document.php} | 12 +- src/Providers/FilamentServiceProvider.php | 8 +- src/Providers/RouteServiceProvider.php | 2 +- src/Skeleton.php | 7 - src/UI/API/Controllers/Controller.php | 2 +- src/UI/API/Controllers/DocumentController.php | 20 ++ .../API/Controllers/SingleNameController.php | 20 -- src/UI/API/Routes/api.php | 6 +- ...eNameResource.php => DocumentResource.php} | 28 +- .../Pages/CreateDocument.php} | 8 +- .../Pages/EditDocument.php} | 8 +- .../Pages/ListDocument.php} | 8 +- tests/Pest.php | 2 +- tests/TestCase.php | 10 +- 33 files changed, 163 insertions(+), 443 deletions(-) create mode 100644 config/admin-kit-documents.php delete mode 100644 config/skeleton.php delete mode 100644 configure.php create mode 100644 database/factories/DocumentFactory.php delete mode 100644 database/factories/SingleNameFactory.php rename database/migrations/{create_skeleton_table.php.stub => create_admin_kit_documents_table.php.stub} (75%) rename resources/lang/en/{skeleton_without_prefix.php => documents.php} (71%) rename resources/lang/ru/{skeleton_without_prefix.php => documents.php} (71%) rename src/Commands/{SkeletonCommand.php => DocumentsCommand.php} (61%) create mode 100755 src/Documents.php rename src/{SkeletonServiceProvider.php => DocumentsServiceProvider.php} (59%) create mode 100644 src/Facades/Documents.php delete mode 100644 src/Facades/Skeleton.php rename src/Models/{SingleName.php => Document.php} (56%) delete mode 100755 src/Skeleton.php create mode 100644 src/UI/API/Controllers/DocumentController.php delete mode 100644 src/UI/API/Controllers/SingleNameController.php rename src/UI/Filament/Resources/{SingleNameResource.php => DocumentResource.php} (63%) rename src/UI/Filament/Resources/{SingleNameResource/Pages/CreateSingleName.php => DocumentResource/Pages/CreateDocument.php} (50%) rename src/UI/Filament/Resources/{SingleNameResource/Pages/EditSingleName.php => DocumentResource/Pages/EditDocument.php} (54%) rename src/UI/Filament/Resources/{SingleNameResource/Pages/ListSingleName.php => DocumentResource/Pages/ListDocument.php} (54%) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 3b0259c..9a65e39 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,11 +1,11 @@ blank_issues_enabled: false contact_links: - name: Ask a question - url: https://github.com/:github_name/:package_name/discussions/new?category=q-a + url: https://github.com/ibec-box/admin-kit-documents/discussions/new?category=q-a about: Ask the community for help - name: Request a feature - url: https://github.com/:github_name/:package_name/discussions/new?category=ideas + url: https://github.com/ibec-box/admin-kit-documents/discussions/new?category=ideas about: Share ideas for new features - name: Report a security issue - url: https://github.com/:github_name/:package_name/security/policy + url: https://github.com/ibec-box/admin-kit-documents/security/policy about: Learn how to notify us for sensitive bugs diff --git a/CHANGELOG.md b/CHANGELOG.md index 87b3242..1927013 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,3 @@ # Changelog -All notable changes to `:package_name` will be documented in this file. +All notable changes to `admin-kit-documents` will be documented in this file. diff --git a/LICENSE.md b/LICENSE.md index f334c37..410805e 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) :github_name +Copyright (c) ibec-box Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 7a51d68..8f6c591 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,10 @@ -# :package_description - -[![Latest Version on Packagist](https://img.shields.io/packagist/v/:github_name/:package_slug.svg?style=flat-square)](https://packagist.org/packages/:packagist_name/:package_slug) -[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/:github_name/:package_slug/run-tests.yml?branch=2.x&label=tests&style=flat-square)](https://github.com/:github_name/:package_slug/actions?query=workflow%3Arun-tests+branch%3A2.x) -[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/:github_name/:package_slug/fix-php-code-style-issues.yml?branch=2.x&label=code%20style&style=flat-square)](https://github.com/:github_name/:package_slug/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3A2.x) -[![Total Downloads](https://img.shields.io/packagist/dt/:github_name/:package_slug.svg?style=flat-square)](https://packagist.org/packages/:packagist_name/:package_slug) - ---- -This repo can be used to scaffold a Laravel package. Follow these steps to get started: - -1. Press the "Use this template" button at the top of this repo to create a new repo with the contents of this skeleton. -2. Run "php ./configure.php" to run a script that will replace all placeholders throughout all the files. -3. Have fun creating your package. -4. If you need help creating a package, consider picking up our Laravel Package Training video course. ---- - +# Documents package for Admin Kit + +[![Latest Version on Packagist](https://img.shields.io/packagist/v/ibec-box/admin-kit-documents.svg?style=flat-square)](https://packagist.org/packages/ibecsystems/admin-kit-documents) +[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/ibec-box/admin-kit-documents/run-tests.yml?branch=2.x&label=tests&style=flat-square)](https://github.com/ibec-box/admin-kit-documents/actions?query=workflow%3Arun-tests+branch%3A2.x) +[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/ibec-box/admin-kit-documents/fix-php-code-style-issues.yml?branch=2.x&label=code%20style&style=flat-square)](https://github.com/ibec-box/admin-kit-documents/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3A2.x) +[![Total Downloads](https://img.shields.io/packagist/dt/ibec-box/admin-kit-documents.svg?style=flat-square)](https://packagist.org/packages/ibecsystems/admin-kit-documents) + This is where your description should go. Limit it to a paragraph or two. Consider adding a small example. ## Installation @@ -21,20 +12,20 @@ This is where your description should go. Limit it to a paragraph or two. Consid You can install the package via composer: ```bash -composer require :packagist_name/:package_slug +composer require ibecsystems/admin-kit-documents ``` You can publish and run the migrations with: ```bash -php artisan vendor:publish --tag=":package_slug-migrations" +php artisan vendor:publish --tag="admin-kit-documents-migrations" php artisan migrate ``` You can publish the config file with: ```bash -php artisan vendor:publish --tag=":package_slug-config" +php artisan vendor:publish --tag="admin-kit-documents-config" ``` This is the contents of the published config file: @@ -47,14 +38,14 @@ return [ Optionally, you can publish the views using ```bash -php artisan vendor:publish --tag=":package_slug-views" +php artisan vendor:publish --tag="admin-kit-documents-views" ``` ## Usage ```php -$variable = new VendorName\Skeleton(); -echo $variable->echoPhrase('Hello, VendorName!'); +$documents = new AdminKit\Documents(); +echo $documents->echoPhrase('Hello, AdminKit!'); ``` ## Testing @@ -77,7 +68,7 @@ Please review [our security policy](../../security/policy) on how to report secu ## Credits -- [:author_name](https://github.com/:author_username) +- [Anastas Mironov](https://github.com/ast21) - [All Contributors](../../contributors) ## License diff --git a/composer.json b/composer.json index 7abc35c..e4f7052 100644 --- a/composer.json +++ b/composer.json @@ -1,17 +1,17 @@ { - "name": ":packagist_name/:package_slug", - "description": ":package_description", + "name": "ibecsystems/admin-kit-documents", + "description": "Documents package for Admin Kit", "keywords": [ - ":github_name", + "ibec-box", "laravel", - ":package_slug" + "admin-kit-documents" ], - "homepage": "https://github.com/:github_name/:package_slug", + "homepage": "https://github.com/ibec-box/admin-kit-documents", "license": "MIT", "authors": [ { - "name": ":author_name", - "email": "author@domain.com", + "name": "Anastas Mironov", + "email": "ast@l80.ru", "role": "Developer" } ], @@ -41,13 +41,13 @@ }, "autoload": { "psr-4": { - "VendorName\\Skeleton\\": "src/", - "VendorName\\Skeleton\\Database\\Factories\\": "database/factories/" + "AdminKit\\Documents\\": "src/", + "AdminKit\\Documents\\Database\\Factories\\": "database/factories/" } }, "autoload-dev": { "psr-4": { - "VendorName\\Skeleton\\Tests\\": "tests/" + "AdminKit\\Documents\\Tests\\": "tests/" } }, "scripts": { @@ -67,10 +67,10 @@ "extra": { "laravel": { "providers": [ - "VendorName\\Skeleton\\SkeletonServiceProvider" + "AdminKit\\Documents\\DocumentsServiceProvider" ], "aliases": { - "Skeleton": "VendorName\\Skeleton\\Facades\\Skeleton" + "Documents": "AdminKit\\Documents\\Facades\\Documents" } } }, diff --git a/config/admin-kit-documents.php b/config/admin-kit-documents.php new file mode 100644 index 0000000..7bc49d4 --- /dev/null +++ b/config/admin-kit-documents.php @@ -0,0 +1,6 @@ + $version) { - if (in_array($name, $names, true)) { - unset($data['require-dev'][$name]); - } - } - - file_put_contents(__DIR__.'/composer.json', json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE)); -} - -function remove_composer_script($scriptName) -{ - $data = json_decode(file_get_contents(__DIR__.'/composer.json'), true); - - foreach ($data['scripts'] as $name => $script) { - if ($scriptName === $name) { - unset($data['scripts'][$name]); - break; - } - } - - file_put_contents(__DIR__.'/composer.json', json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE)); -} - -function remove_readme_paragraphs(string $file): void -{ - $contents = file_get_contents($file); - - file_put_contents( - $file, - preg_replace('/.*/s', '', $contents) ?: $contents - ); -} - -function safeUnlink(string $filename) -{ - if (file_exists($filename) && is_file($filename)) { - unlink($filename); - } -} - -function determineSeparator(string $path): string -{ - return str_replace('/', DIRECTORY_SEPARATOR, $path); -} - -function replaceForWindows(): array -{ - return preg_split('/\\r\\n|\\r|\\n/', run('dir /S /B * | findstr /v /i .git\ | findstr /v /i vendor | findstr /v /i '.basename(__FILE__).' | findstr /r /i /M /F:/ ":author :vendor :package VendorName skeleton migration_table_name github_name packagist_name author@domain.com"')); -} - -function replaceForAllOtherOSes(): array -{ - return explode(PHP_EOL, run('grep -E -r -l -i ":author|:vendor|:package|VendorName|skeleton|migration_table_name|github_name|packagist_name|author@domain.com" --exclude-dir=vendor ./* ./.github/* | grep -v '.basename(__FILE__))); -} - -$gitName = run('git config user.name'); -$authorName = ask('Author name', $gitName); - -$gitEmail = run('git config user.email'); -$authorEmail = ask('Author email', $gitEmail); - -$usernameGuess = explode(':', run('git config remote.origin.url'))[1]; -$usernameGuess = dirname($usernameGuess); -$usernameGuess = basename($usernameGuess); -$authorUsername = ask('Author username', $usernameGuess); - -$githubName = 'ibec-box'; -$packagistName = 'ibecsystems'; -$vendorNamespace = 'AdminKit'; - -$currentDirectory = getcwd(); -$folderName = basename($currentDirectory); - -$packageName = ask('Package name', $folderName); -$packageSlug = slugify($packageName); -$packageSlugWithoutPrefix = remove_prefix('admin-kit-', $packageSlug); - -$className = ask('Class name', title_case($packageSlugWithoutPrefix)); -$singleName = ask('Single name', $className); -$description = ask('Package description', "$className package for Admin Kit"); -$variableName = lcfirst($className); - -$usePhpStan = confirm('Enable PhpStan?', true); -$useLaravelPint = confirm('Enable Laravel Pint?', true); -$useDependabot = confirm('Enable Dependabot?', true); -$useUpdateChangelogWorkflow = confirm('Use automatic changelog updater workflow?', true); - -writeln('------'); -writeln("Author : {$authorName} ({$authorUsername}, {$authorEmail})"); -writeln("Vendor : {$githubName} ({$packagistName})"); -writeln("Package : {$packageSlug} <{$description}>"); -writeln("Namespace : {$vendorNamespace}\\{$className}"); -writeln("Class name : {$className}"); -writeln('---'); -writeln('Packages & Utilities'); -writeln('Use Laravel/Pint : '.($useLaravelPint ? 'yes' : 'no')); -writeln('Use Larastan/PhpStan : '.($usePhpStan ? 'yes' : 'no')); -writeln('Use Dependabot : '.($useDependabot ? 'yes' : 'no')); -writeln('Use Auto-Changelog : '.($useUpdateChangelogWorkflow ? 'yes' : 'no')); -writeln('------'); - -writeln('This script will replace the above values in all relevant files in the project directory.'); - -if (! confirm('Modify files?', true)) { - exit(1); -} - -$files = (str_starts_with(strtoupper(PHP_OS), 'WIN') ? replaceForWindows() : replaceForAllOtherOSes()); - -foreach ($files as $file) { - replace_in_file($file, [ - ':author_name' => $authorName, - ':author_username' => $authorUsername, - 'author@domain.com' => $authorEmail, - ':github_name' => $githubName, - ':packagist_name' => $packagistName, - 'VendorName' => $vendorNamespace, - ':package_name' => $packageName, - ':package_slug' => $packageSlug, - 'Skeleton' => $className, - 'skeleton_without_prefix' => $packageSlugWithoutPrefix, - 'skeleton' => $packageSlug, - 'SingleName' => $singleName, - 'migration_table_name' => title_snake($packageSlug), - 'variable' => $variableName, - ':package_description' => $description, - ]); - - match (true) { - str_contains($file, determineSeparator('src/UI/API/Controllers/SingleNameController.php')) => rename($file, determineSeparator('./src/UI/API/Controllers/'.$singleName.'Controller.php')), - str_contains($file, determineSeparator('src/UI/Filament/Resources/SingleNameResource.php')) => rename($file, determineSeparator('./src/UI/Filament/Resources/'.$singleName.'Resource.php')), - str_contains($file, determineSeparator('src/UI/Filament/Resources/SingleNameResource/Pages/CreateSingleName.php')) => rename($file, determineSeparator('./src/UI/Filament/Resources/SingleNameResource/Pages/Create'.$singleName.'.php')), - str_contains($file, determineSeparator('src/UI/Filament/Resources/SingleNameResource/Pages/EditSingleName.php')) => rename($file, determineSeparator('./src/UI/Filament/Resources/SingleNameResource/Pages/Edit'.$singleName.'.php')), - str_contains($file, determineSeparator('src/UI/Filament/Resources/SingleNameResource/Pages/ListSingleName.php')) => rename($file, determineSeparator('./src/UI/Filament/Resources/SingleNameResource/Pages/List'.$singleName.'.php')), - str_contains($file, determineSeparator('src/Models/SingleName.php')) => rename($file, determineSeparator('./src/Models/'.$singleName.'.php')), - str_contains($file, determineSeparator('src/Skeleton.php')) => rename($file, determineSeparator('./src/'.$className.'.php')), - str_contains($file, determineSeparator('src/SkeletonServiceProvider.php')) => rename($file, determineSeparator('./src/'.$className.'ServiceProvider.php')), - str_contains($file, determineSeparator('src/Facades/Skeleton.php')) => rename($file, determineSeparator('./src/Facades/'.$className.'.php')), - str_contains($file, determineSeparator('src/Commands/SkeletonCommand.php')) => rename($file, determineSeparator('./src/Commands/'.$className.'Command.php')), - str_contains($file, determineSeparator('database/factories/SingleNameFactory.php')) => rename($file, determineSeparator('./database/factories/'.$singleName.'Factory.php')), - str_contains($file, determineSeparator('database/migrations/create_skeleton_table.php.stub')) => rename($file, determineSeparator('./database/migrations/create_'.title_snake($packageSlug).'_table.php.stub')), - str_contains($file, determineSeparator('resources/lang/en/skeleton_without_prefix.php')) => rename($file, determineSeparator('./resources/lang/en/'.$packageSlugWithoutPrefix.'.php')), - str_contains($file, determineSeparator('resources/lang/ru/skeleton_without_prefix.php')) => rename($file, determineSeparator('./resources/lang/ru/'.$packageSlugWithoutPrefix.'.php')), - str_contains($file, determineSeparator('config/skeleton.php')) => rename($file, determineSeparator('./config/'.$packageSlug.'.php')), - str_contains($file, 'README.md') => remove_readme_paragraphs($file), - default => [], - }; -} - -rename('src/UI/Filament/Resources/SingleNameResource', determineSeparator('./src/UI/Filament/Resources/'.$singleName.'Resource')); - -if (! $useLaravelPint) { - safeUnlink(__DIR__.'/.github/workflows/fix-php-code-style-issues.yml'); - safeUnlink(__DIR__.'/pint.json'); -} - -if (! $usePhpStan) { - safeUnlink(__DIR__.'/phpstan.neon.dist'); - safeUnlink(__DIR__.'/phpstan-baseline.neon'); - safeUnlink(__DIR__.'/.github/workflows/phpstan.yml'); - - remove_composer_deps([ - 'phpstan/extension-installer', - 'phpstan/phpstan-deprecation-rules', - 'phpstan/phpstan-phpunit', - 'nunomaduro/larastan', - ]); - - remove_composer_script('phpstan'); -} - -if (! $useDependabot) { - safeUnlink(__DIR__.'/.github/dependabot.yml'); - safeUnlink(__DIR__.'/.github/workflows/dependabot-auto-merge.yml'); -} - -if (! $useUpdateChangelogWorkflow) { - safeUnlink(__DIR__.'/.github/workflows/update-changelog.yml'); -} - -confirm('Execute `composer install` and run tests?') && run('composer install && composer test'); - -confirm('Let this script delete itself?', true) && unlink(__FILE__); diff --git a/database/factories/DocumentFactory.php b/database/factories/DocumentFactory.php new file mode 100644 index 0000000..3af52c5 --- /dev/null +++ b/database/factories/DocumentFactory.php @@ -0,0 +1,18 @@ +id(); // add fields @@ -20,6 +20,6 @@ return new class extends Migration public function down() { - Schema::dropIfExists('migration_table_name'); + Schema::dropIfExists('admin_kit_documents'); } }; diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 0ebf661..7e9be16 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -16,7 +16,7 @@ backupStaticProperties="false" > - + tests diff --git a/resources/lang/en/skeleton_without_prefix.php b/resources/lang/en/documents.php similarity index 71% rename from resources/lang/en/skeleton_without_prefix.php rename to resources/lang/en/documents.php index b9df386..32833fa 100644 --- a/resources/lang/en/skeleton_without_prefix.php +++ b/resources/lang/en/documents.php @@ -2,8 +2,8 @@ return [ 'resource' => [ - 'label' => 'SingleName', - 'plural_label' => 'Skeleton', + 'label' => 'Document', + 'plural_label' => 'Documents', 'id' => 'ID', 'title' => 'Title', diff --git a/resources/lang/ru/skeleton_without_prefix.php b/resources/lang/ru/documents.php similarity index 71% rename from resources/lang/ru/skeleton_without_prefix.php rename to resources/lang/ru/documents.php index b9df386..32833fa 100644 --- a/resources/lang/ru/skeleton_without_prefix.php +++ b/resources/lang/ru/documents.php @@ -2,8 +2,8 @@ return [ 'resource' => [ - 'label' => 'SingleName', - 'plural_label' => 'Skeleton', + 'label' => 'Document', + 'plural_label' => 'Documents', 'id' => 'ID', 'title' => 'Title', diff --git a/src/Commands/SkeletonCommand.php b/src/Commands/DocumentsCommand.php similarity index 61% rename from src/Commands/SkeletonCommand.php rename to src/Commands/DocumentsCommand.php index 3e5f628..0f0716f 100644 --- a/src/Commands/SkeletonCommand.php +++ b/src/Commands/DocumentsCommand.php @@ -1,12 +1,12 @@ name('skeleton') + ->name('admin-kit-documents') ->hasConfigFile() ->hasViews() ->hasTranslations() - ->hasMigration('create_migration_table_name_table') - ->hasCommand(SkeletonCommand::class); + ->hasMigration('create_admin_kit_documents_table') + ->hasCommand(DocumentsCommand::class); } public function registeringPackage() diff --git a/src/Facades/Documents.php b/src/Facades/Documents.php new file mode 100644 index 0000000..e790ea7 --- /dev/null +++ b/src/Facades/Documents.php @@ -0,0 +1,16 @@ +schema([ Forms\Components\TextInput::make('title') - ->label(__('skeleton::skeleton_without_prefix.resource.title')) + ->label(__('admin-kit-documents::documents.resource.title')) ->required(), ]) ->columns(1); @@ -35,12 +35,12 @@ public static function table(Table $table): Table return $table ->columns([ Tables\Columns\TextColumn::make('id') - ->label(__('skeleton::skeleton_without_prefix.resource.id')) + ->label(__('admin-kit-documents::documents.resource.id')) ->sortable(), Tables\Columns\TextColumn::make('title') - ->label(__('skeleton::skeleton_without_prefix.resource.title')), + ->label(__('admin-kit-documents::documents.resource.title')), Tables\Columns\TextColumn::make('created_at') - ->label(__('skeleton::skeleton_without_prefix.resource.created_at')), + ->label(__('admin-kit-documents::documents.resource.created_at')), ]) ->defaultSort('id', 'desc') ->filters([ @@ -65,20 +65,20 @@ public static function getRelations(): array public static function getPages(): array { return [ - 'index' => Pages\ListSingleName::route('/'), - 'create' => Pages\CreateSingleName::route('/create'), - 'edit' => Pages\EditSingleName::route('/{record}/edit'), + 'index' => Pages\ListDocument::route('/'), + 'create' => Pages\CreateDocument::route('/create'), + 'edit' => Pages\EditDocument::route('/{record}/edit'), ]; } public static function getLabel(): ?string { - return __('skeleton::skeleton_without_prefix.resource.label'); + return __('admin-kit-documents::documents.resource.label'); } public static function getPluralLabel(): ?string { - return __('skeleton::skeleton_without_prefix.resource.plural_label'); + return __('admin-kit-documents::documents.resource.plural_label'); } public static function getTranslatableLocales(): array diff --git a/src/UI/Filament/Resources/SingleNameResource/Pages/CreateSingleName.php b/src/UI/Filament/Resources/DocumentResource/Pages/CreateDocument.php similarity index 50% rename from src/UI/Filament/Resources/SingleNameResource/Pages/CreateSingleName.php rename to src/UI/Filament/Resources/DocumentResource/Pages/CreateDocument.php index 936f543..b176529 100644 --- a/src/UI/Filament/Resources/SingleNameResource/Pages/CreateSingleName.php +++ b/src/UI/Filament/Resources/DocumentResource/Pages/CreateDocument.php @@ -1,16 +1,16 @@ in(__DIR__); diff --git a/tests/TestCase.php b/tests/TestCase.php index 9b407a3..5eb9b8d 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -1,11 +1,11 @@ 'VendorName\\Skeleton\\Database\\Factories\\'.class_basename($modelName).'Factory' + fn (string $modelName) => 'AdminKit\\Documents\\Database\\Factories\\'.class_basename($modelName).'Factory' ); } protected function getPackageProviders($app) { return [ - SkeletonServiceProvider::class, + DocumentsServiceProvider::class, LivewireServiceProvider::class, ]; } @@ -30,7 +30,7 @@ public function getEnvironmentSetUp($app) config()->set('database.default', 'testing'); /* - $migration = include __DIR__.'/../database/migrations/create_skeleton_table.php.stub'; + $migration = include __DIR__.'/../database/migrations/create_admin-kit-documents_table.php.stub'; $migration->up(); */ }