Skip to content
This repository was archived by the owner on Apr 16, 2024. It is now read-only.

Commit f6b396f

Browse files
committed
Merge branch 'dev'
2 parents 86bbcaa + 8b35bd7 commit f6b396f

File tree

4 files changed

+59
-10
lines changed

4 files changed

+59
-10
lines changed

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,45 @@
1+
# Lucid • Console
12
The Console companion for the Lucid Architecture.
3+
4+
## Command Line Interface
5+
The console ships with a command line interface called `lucid` that you can find in `vendor/bin/lucid` and use as
6+
```
7+
lucid make:feature ListUsers Api
8+
```
9+
10+
> To be able to address the `lucid` cli directly you need to have `./vendor/bin` as part of your `$PATH`.
11+
To do that, put this in your shell profile (~/.bash_profile, ~/.zshrc, ~/bashrc) `export PATH="$PATH:./vendor/bin`"
12+
13+
### Available Commands
14+
15+
- `help` Displays help for a command
16+
- `list` Lists commands
17+
- **make**
18+
- `make:controller` Create a new resource Controller class in a service
19+
- `make:feature ` Create a new Feature in a service
20+
- `make:job ` Create a new Job in a domain
21+
- `make:service ` Create a new Service
22+
- **list**
23+
- `list:features` List the features.
24+
- `list:services` List the services in this project.
25+
- **delete**
26+
- `delete:feature` Delete an existing Feature in a service
27+
- `delete:job ` Delete an existing Job in a domain
28+
- `delete:service` Delete an existing Service
29+
30+
### Commands Usage
31+
32+
#### Make
33+
- `make:controller <controller> [<service>]`
34+
- `make:feature <feature> [<service>]`
35+
- `make:job <job> <domain>`
36+
- `make:service <name>`
37+
38+
#### List
39+
- `list:services`
40+
- `list:features [<service>]`
41+
42+
#### Delete
43+
- `delete:service <name>`
44+
- `delete:feature <feature> [<service>]`
45+
- `delete:job <job> <domain>`

src/Commands/FeatureDeleteCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class FeatureDeleteCommand extends SymfonyCommand
5656
public function fire()
5757
{
5858
try {
59-
$service = studly_case($this->argument('service'));
59+
$service = Str::service($this->argument('service'));
6060
$title = $this->parseName($this->argument('feature'));
6161

6262
if (!$this->exists($feature = $this->findFeaturePath($service, $title))) {
@@ -79,8 +79,8 @@ public function fire()
7979
protected function getArguments()
8080
{
8181
return [
82-
['service', InputArgument::REQUIRED, 'The service in which the feature should be deleted from.'],
8382
['feature', InputArgument::REQUIRED, 'The feature\'s name.'],
83+
['service', InputArgument::OPTIONAL, 'The service from which the feature should be deleted.'],
8484
];
8585
}
8686

src/Commands/JobDeleteCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ public function fire()
7878
public function getArguments()
7979
{
8080
return [
81-
['domain', InputArgument::REQUIRED, 'The domain from which the job will be deleted.'],
8281
['job', InputArgument::REQUIRED, 'The job\'s name.'],
82+
['domain', InputArgument::REQUIRED, 'The domain from which the job will be deleted.'],
8383
];
8484
}
8585

src/Commands/ServiceDeleteCommand.php

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Lucid\Console\Commands;
1313

14+
use Lucid\Console\Str;
1415
use Lucid\Console\Finder;
1516
use Lucid\Console\Command;
1617
use Lucid\Console\Filesystem;
@@ -71,18 +72,22 @@ protected function getStub()
7172
*/
7273
public function fire()
7374
{
75+
if ($this->isMicroservice()) {
76+
return $this->error('This functionality is disabled in a Microservice');
77+
}
78+
7479
try {
75-
$name = ucfirst($this->argument('name'));
80+
$name = Str::service($this->argument('name'));
7681

7782
if (!$this->exists($service = $this->findServicePath($name))) {
78-
$this->error('Service '.$name.' cannot be found.');
79-
} else {
80-
$this->delete($service);
83+
return $this->error('Service '.$name.' cannot be found.');
84+
}
8185

82-
$this->info('Service <comment>'.$name.'</comment> deleted successfully.'."\n");
86+
$this->delete($service);
8387

84-
$this->info('Please remove your registered service providers, if any.');
85-
}
88+
$this->info('Service <comment>'.$name.'</comment> deleted successfully.'."\n");
89+
90+
$this->info('Please remove your registered service providers, if any.');
8691
} catch (\Exception $e) {
8792
dd($e->getMessage(), $e->getFile(), $e->getLine());
8893
}

0 commit comments

Comments
 (0)