Skip to content

Commit 93d9886

Browse files
committed
Changing Namespace from ApiCrudto Crud
1 parent 8c9fc8a commit 93d9886

33 files changed

+145
-174
lines changed

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
blank_issues_enabled: false
22
contact_links:
33
- name: Ask a question
4-
url: https://github.com/laraflow/api-crud/discussions/new?category=q-a
4+
url: https://github.com/laraflow/crud/discussions/new?category=q-a
55
about: Ask the community for help
66
- name: Request a feature
7-
url: https://github.com/laraflow/api-crud/discussions/new?category=ideas
7+
url: https://github.com/laraflow/crud/discussions/new?category=ideas
88
about: Share ideas for new features
99
- name: Report a security issue
10-
url: https://github.com/laraflow/api-crud/security/policy
10+
url: https://github.com/laraflow/crud/security/policy
1111
about: Learn how to notify us for sensitive bugs

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Changelog
22

3-
All notable changes to `api-crud` will be documented in this file.
3+
All notable changes to `crud` will be documented in this file.

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# API CRUD
22

3-
[![Latest Version on Packagist](https://img.shields.io/packagist/v/laraflow/api-crud.svg?style=flat-square)](https://packagist.org/packages/laraflow/api-crud)
4-
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/laraflow/api-crud/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/laraflow/api-crud/actions?query=workflow%3Arun-tests+branch%3Amain)
5-
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/laraflow/api-crud/fix-php-code-style-issues.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/laraflow/api-crud/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
6-
[![Total Downloads](https://img.shields.io/packagist/dt/laraflow/api-crud.svg?style=flat-square)](https://packagist.org/packages/laraflow/api-crud)
3+
[![Latest Version on Packagist](https://img.shields.io/packagist/v/laraflow/crud.svg?style=flat-square)](https://packagist.org/packages/laraflow/crud)
4+
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/laraflow/crud/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/laraflow/crud/actions?query=workflow%3Arun-tests+branch%3Amain)
5+
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/laraflow/crud/fix-php-code-style-issues.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/laraflow/crud/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
6+
[![Total Downloads](https://img.shields.io/packagist/dt/laraflow/crud.svg?style=flat-square)](https://packagist.org/packages/laraflow/crud)
77

88
This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.
99

@@ -12,7 +12,7 @@ This is where your description should go. Limit it to a paragraph or two. Consid
1212
You can install the package via composer:
1313

1414
```bash
15-
composer require laraflow/api-crud
15+
composer require laraflow/crud
1616
```
1717

1818
After that run this command to configure project.

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ Tell them where to go, how often they can expect to get an update on a
1818
reported vulnerability, what to expect if the vulnerability is accepted or
1919
declined, etc.
2020

21-
Please review [our security policy](https://github.com/laraflow/api-crud/security/policy) on how to report security vulnerabilities.
21+
Please review [our security policy](https://github.com/laraflow/crud/security/policy) on how to report security vulnerabilities.

composer.json

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
{
2-
"name": "laraflow/api-crud",
3-
"description": "This is my package api-crud",
2+
"name": "laraflow/crud",
3+
"description": "Laraflow CRUD stub files generator and utility functions.",
44
"keywords": [
55
"laraflow",
66
"laravel",
7-
"api-crud"
7+
"crud",
8+
"generator",
9+
"utility",
10+
"marco",
11+
"restapi",
12+
"restful",
13+
"openapi3"
814
],
9-
"homepage": "https://github.com/laraflow/api-crud",
15+
"homepage": "https://github.com/laraflow/crud",
1016
"license": "MIT",
1117
"authors": [
1218
{
@@ -33,15 +39,15 @@
3339
},
3440
"autoload": {
3541
"psr-4": {
36-
"Laraflow\\ApiCrud\\": "src/"
42+
"Laraflow\\Crud\\": "src/"
3743
},
3844
"files": [
3945
"src/helpers.php"
4046
]
4147
},
4248
"autoload-dev": {
4349
"psr-4": {
44-
"Laraflow\\ApiCrud\\Tests\\": "tests/"
50+
"Laraflow\\Crud\\Tests\\": "tests/"
4551
}
4652
},
4753
"scripts": {
@@ -61,12 +67,10 @@
6167
"extra": {
6268
"laravel": {
6369
"providers": [
64-
"Laraflow\\ApiCrud\\Providers\\ApiCrudServiceProvider"
70+
"Laraflow\\Crud\\CrudServiceProvider"
6571
]
6672
}
6773
},
68-
"minimum-stability": "dev",
69-
"prefer-stable": true,
7074
"suggest": {
7175
"rakutentech/laravel-request-docs": "For Live Docs & OpenAPI 3 export Generation"
7276
}

config/api-crud.php renamed to config/crud.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,15 @@
5151
*/
5252
'root_path' => 'app',
5353

54+
/*
55+
|--------------------------------------------------------------------------
56+
| Use Simple Message
57+
|--------------------------------------------------------------------------
58+
| This setting will return the actual debug error messages with simple
59+
| failed message
60+
*/
61+
'simple_message' => true,
62+
5463
/*
5564
|--------------------------------------------------------------------------
5665
| Template Settings

src/Abstracts/GeneratorCommand.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<?php
22

3-
namespace Laraflow\ApiCrud\Abstracts;
3+
namespace Laraflow\Crud\Abstracts;
44

55
use Illuminate\Console\Command;
66
use Illuminate\Support\Str;
77
use InvalidArgumentException;
8-
use Laraflow\ApiCrud\Exceptions\FileAlreadyExistException;
9-
use Laraflow\ApiCrud\Exceptions\GeneratorException;
10-
use Laraflow\ApiCrud\Generators\FileGenerator;
11-
use Laraflow\ApiCrud\Support\Config\GenerateConfigReader;
8+
use Laraflow\Crud\Exceptions\FileAlreadyExistException;
9+
use Laraflow\Crud\Exceptions\GeneratorException;
10+
use Laraflow\Crud\Generators\FileGenerator;
11+
use Laraflow\Crud\Support\Config\GenerateConfigReader;
1212

1313
abstract class GeneratorCommand extends Command
1414
{
@@ -31,7 +31,7 @@ public function handle(): int
3131
* Disable Script on Testing environment
3232
* also Disable through configuration
3333
*/
34-
if (app()->environment('testing') || ! config('api-crud.enabled', false)) {
34+
if (app()->environment('testing') || ! config('crud.enabled', false)) {
3535
return self::SUCCESS;
3636
}
3737

@@ -70,7 +70,7 @@ protected function getDestinationFilePath(): string
7070
{
7171
$config = GenerateConfigReader::read($this->type);
7272

73-
return config('api-crud.root_path', 'app').'/'
73+
return config('crud.root_path', 'app').'/'
7474
.$config->getPath().'/'
7575
.$this->getFileName();
7676
}
@@ -102,7 +102,7 @@ public function getClassNamespace(?string $module = null): string
102102

103103
$extra = str_replace('/', '\\', $extra);
104104

105-
$namespace = config('api-crud.namespace');
105+
$namespace = config('crud.namespace');
106106

107107
$namespace .= '\\'.$this->getDefaultNamespace();
108108

@@ -140,11 +140,11 @@ public function getDefaultNamespace($type = null): string
140140
throw new GeneratorException('Stub type argument or property is not configured.');
141141
}
142142

143-
if (! config("api-crud.templates.{$type}")) {
143+
if (! config("crud.templates.{$type}")) {
144144
throw new InvalidArgumentException("Generator is missing [{$type}] config, check generators.php file.");
145145
}
146146

147-
$config = config("api-crud.templates.{$type}");
147+
$config = config("crud.templates.{$type}");
148148

149149
return $config['namespace'] ?? $config['path'];
150150

src/Commands/ControllerMakeCommand.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?php
22

3-
namespace Laraflow\ApiCrud\Commands;
3+
namespace Laraflow\Crud\Commands;
44

55
use Illuminate\Support\Str;
6-
use Laraflow\ApiCrud\Abstracts\GeneratorCommand;
7-
use Laraflow\ApiCrud\Exceptions\GeneratorException;
8-
use Laraflow\ApiCrud\Support\Stub;
9-
use Laraflow\ApiCrud\Traits\ModuleCommandTrait;
6+
use Laraflow\Crud\Abstracts\GeneratorCommand;
7+
use Laraflow\Crud\Exceptions\GeneratorException;
8+
use Laraflow\Crud\Support\Stub;
9+
use Laraflow\Crud\Traits\ModuleCommandTrait;
1010
use Symfony\Component\Console\Input\InputArgument;
1111
use Symfony\Component\Console\Input\InputOption;
1212

@@ -52,7 +52,7 @@ protected function getTemplateContents(): string
5252
'CLASS' => $this->getClass(),
5353
'MODULE' => $this->getModuleName(),
5454
'LOWER_NAME' => Str::lower($this->getModuleName()),
55-
'MODULE_NAMESPACE' => config('api-crud.namespace'),
55+
'MODULE_NAMESPACE' => config('crud.namespace'),
5656
'PARENT_CONTROLLER' => $this->getParentController(),
5757
//CRUD Options
5858
'RESOURCE' => $this->getResourceName(),
@@ -79,7 +79,7 @@ protected function getTemplateContents(): string
7979
*/
8080
private function getParentController() : string
8181
{
82-
$controllerName = config('api-crud.parent_controller');
82+
$controllerName = config('crud.parent_controller');
8383

8484
if (!$controllerName || !class_exists($controllerName)) {
8585
throw new GeneratorException("Parent Controller class {$controllerName} does not exist.");

src/Commands/CrudMakeCommand.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<?php
22

3-
namespace Laraflow\ApiCrud\Commands;
3+
namespace Laraflow\Crud\Commands;
44

55
use Illuminate\Console\Command;
66
use Illuminate\Support\Str;
77
use InvalidArgumentException;
8-
use Laraflow\ApiCrud\Exceptions\GeneratorException;
9-
use Laraflow\ApiCrud\Support\Config\GenerateConfigReader;
10-
use Laraflow\ApiCrud\Support\Config\GeneratorPath;
11-
use Laraflow\ApiCrud\Traits\ModuleCommandTrait;
8+
use Laraflow\Crud\Exceptions\GeneratorException;
9+
use Laraflow\Crud\Support\Config\GenerateConfigReader;
10+
use Laraflow\Crud\Support\Config\GeneratorPath;
11+
use Laraflow\Crud\Traits\ModuleCommandTrait;
1212
use Symfony\Component\Console\Input\InputArgument;
1313
use Symfony\Component\Console\Input\InputOption;
1414
use Throwable;
@@ -104,7 +104,7 @@ private function getResourceName(): string
104104
*/
105105
private function createRequest(): void
106106
{
107-
if (! config('api-crud.templates.request.generate', true)) {
107+
if (! config('crud.templates.request.generate', true)) {
108108
return;
109109
}
110110
foreach (['Index', 'Store', 'Update'] as $prefix) {
@@ -139,7 +139,7 @@ private function createRequest(): void
139139
*/
140140
private function createResource(): void
141141
{
142-
if (! config('api-crud.templates.resource.generate', true)) {
142+
if (! config('crud.templates.resource.generate', true)) {
143143
return;
144144
}
145145
$this->call('laraflow:make-resource', [
@@ -162,7 +162,7 @@ private function createResource(): void
162162
private function createModel(): void
163163
{
164164

165-
if (! config('api-crud.templates.model.generate', true)) {
165+
if (! config('crud.templates.model.generate', true)) {
166166
return;
167167
}
168168

@@ -181,7 +181,7 @@ private function createModel(): void
181181
private function createMigration(): void
182182
{
183183

184-
if (! config('api-crud.templates.migration.generate', true)) {
184+
if (! config('crud.templates.migration.generate', true)) {
185185
return;
186186
}
187187

@@ -200,7 +200,7 @@ private function createMigration(): void
200200
*/
201201
private function createController(): void
202202
{
203-
if (! config('api-crud.templates.controller.generate', true)) {
203+
if (! config('crud.templates.controller.generate', true)) {
204204
return;
205205
}
206206

@@ -217,7 +217,7 @@ private function createController(): void
217217
*/
218218
private function updateRouteFile(): void
219219
{
220-
$filePath = base_path(config('api-crud.route_path', 'routes/api.php'));
220+
$filePath = base_path(config('crud.route_path', 'routes/api.php'));
221221

222222
if (! file_exists($filePath)) {
223223
throw new InvalidArgumentException("Route file location doesn't exist");

src/Commands/InstallCommand.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Laraflow\ApiCrud\Commands;
3+
namespace Laraflow\Crud\Commands;
44

55
use Exception;
66
use Illuminate\Console\Command;
@@ -53,7 +53,7 @@ public function handle()
5353

5454
private function configureRouteFile(): void
5555
{
56-
$routeFilePath = base_path(config('api-crud.route_path', 'routes/api.php'));
56+
$routeFilePath = base_path(config('crud.route_path', 'routes/api.php'));
5757

5858
if (! is_file($routeFilePath)) {
5959
throw new InvalidArgumentException("Invalid API route file path: ({$routeFilePath}).");
@@ -90,7 +90,7 @@ private function confirmConfigPublish(): void
9090
{
9191
if ($this->confirm('Publish Configuration File', false)) {
9292

93-
$this->vendorPublish('api-crud-config', is_file(base_path('config/api-crud.php')));
93+
$this->vendorPublish('crud-config', is_file(base_path('config/crud.php')));
9494
} else {
9595
$this->components->twoColumnDetail(
9696
'Publish Configuration File.',
@@ -117,7 +117,7 @@ private function confirmLanguagePublish(): void
117117
{
118118
if ($this->confirm('Publish Language Files', false)) {
119119

120-
$this->vendorPublish('api-crud-lang', is_dir(app()->langPath('vendor/api-crud')));
120+
$this->vendorPublish('crud-lang', is_dir(app()->langPath('vendor/crud')));
121121
} else {
122122
$this->components->twoColumnDetail(
123123
'Publish Language Files.',
@@ -129,7 +129,7 @@ private function confirmStubsPublish(): void
129129
{
130130
if ($this->confirm('Publish Template Files (Not-Recommended)', false)) {
131131

132-
$this->vendorPublish('api-crud-stubs', is_dir(base_path('stubs/api-crud')));
132+
$this->vendorPublish('crud-stubs', is_dir(base_path('stubs/crud')));
133133
} else {
134134
$this->components->twoColumnDetail(
135135
'Publish Template Files',

0 commit comments

Comments
 (0)