Skip to content

Commit a69fa6e

Browse files
authored
Merge pull request MedicOneSystems#396 from amvisor/rename-command
rename livewire:datatable to make:livewire-datatable
2 parents 9a1fe0d + 74400d9 commit a69fa6e

File tree

4 files changed

+14
-13
lines changed

4 files changed

+14
-13
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,12 @@ other as in the example above.
9898
## Component Syntax
9999

100100
### Create a livewire component that extends ```Mediconesystems\LivewireDatatables\LivewireDatatable```
101-
> ```php artisan livewire:datatable foo``` --> 'app/Http/Livewire/Foo.php'
101+
> ```php artisan make:livewire-datatable foo``` --> 'app/Http/Livewire/Foo.php'
102102
103-
> ```php artisan livewire:datatable tables.bar``` --> 'app/Http/Livewire/Tables/Bar.php'
103+
> ```php artisan make:livewire-datatable tables.bar``` --> 'app/Http/Livewire/Tables/Bar.php'
104104
105105
### Provide a datasource by declaring public property ```$model``` **OR** public method ```builder()``` that returns an instance of ```Illuminate\Database\Eloquent\Builder```
106-
> ```php artisan livewire:datatable users-table --model=user``` --> 'app/Http/Livewire/UsersTable.php' with ```public $model = User::class```
106+
> ```php artisan make:livewire-datatable users-table --model=user``` --> 'app/Http/Livewire/UsersTable.php' with ```public $model = User::class```
107107
108108
### Declare a public method ```columns``` that returns an array containing one or more ```Mediconesystems\LivewireDatatables\Column```
109109

src/Commands/MakeDatatableCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
class MakeDatatableCommand extends FileManipulationCommand
1010
{
11-
protected $signature = 'livewire:datatable {name} {--model=}';
11+
protected $signature = 'make:livewire-datatable {name} {--model=}';
1212

1313
protected $desciption = 'Create a new Livewire Datatable';
1414

src/LivewireDatatablesServiceProvider.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Illuminate\Support\ServiceProvider;
1212
use Illuminate\Support\Str;
1313
use Livewire\Livewire;
14+
use Mediconesystems\LivewireDatatables\Commands\DatatableMakeCommand;
1415
use Mediconesystems\LivewireDatatables\Commands\MakeDatatableCommand;
1516
use Mediconesystems\LivewireDatatables\Http\Controllers\FileExportController;
1617
use Mediconesystems\LivewireDatatables\Http\Livewire\ComplexQuery;
@@ -48,7 +49,7 @@ public function boot()
4849
__DIR__ . '/../resources/views/icons' => resource_path('views/livewire/datatables/icons'),
4950
], 'views');
5051

51-
$this->commands([MakeDatatableCommand::class]);
52+
$this->commands([MakeDatatableCommand::class, DatatableMakeCommand::class]);
5253
}
5354

5455
Route::get('/datatables/{filename}', [FileExportController::class, 'handle'])

tests/MakeDatatableCommandTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,55 +12,55 @@ class MakeDatatableCommandTest extends TestCase
1212
/** @test */
1313
public function component_is_created_by_make_command()
1414
{
15-
Artisan::call('livewire:datatable', ['name' => 'foo']);
15+
Artisan::call('make:livewire-datatable', ['name' => 'foo']);
1616

1717
$this->assertTrue(File::exists($this->livewireClassesPath('Foo.php')));
1818
}
1919

2020
/** @test */
2121
public function dot_nested_component_is_created_by_make_command()
2222
{
23-
Artisan::call('livewire:datatable', ['name' => 'foo.bar']);
23+
Artisan::call('make:livewire-datatable', ['name' => 'foo.bar']);
2424

2525
$this->assertTrue(File::exists($this->livewireClassesPath('Foo/Bar.php')));
2626
}
2727

2828
/** @test */
2929
public function forward_slash_nested_component_is_created_by_make_command()
3030
{
31-
Artisan::call('livewire:datatable', ['name' => 'foo/bar']);
31+
Artisan::call('make:livewire-datatable', ['name' => 'foo/bar']);
3232

3333
$this->assertTrue(File::exists($this->livewireClassesPath('Foo/Bar.php')));
3434
}
3535

3636
/** @test */
3737
public function multiword_component_is_created_by_make_command()
3838
{
39-
Artisan::call('livewire:datatable', ['name' => 'foo-bar']);
39+
Artisan::call('make:livewire-datatable', ['name' => 'foo-bar']);
4040

4141
$this->assertTrue(File::exists($this->livewireClassesPath('FooBar.php')));
4242
}
4343

4444
/** @test */
4545
public function pascal_case_component_is_automatically_converted_by_make_command()
4646
{
47-
Artisan::call('livewire:datatable', ['name' => 'FooBar.FooBar']);
47+
Artisan::call('make:livewire-datatable', ['name' => 'FooBar.FooBar']);
4848

4949
$this->assertTrue(File::exists($this->livewireClassesPath('FooBar/FooBar.php')));
5050
}
5151

5252
/** @test */
5353
public function snake_case_component_is_automatically_converted_by_make_command()
5454
{
55-
Artisan::call('livewire:datatable', ['name' => 'text_replace']);
55+
Artisan::call('make:livewire-datatable', ['name' => 'text_replace']);
5656

5757
$this->assertTrue(File::exists($this->livewireClassesPath('TextReplace.php')));
5858
}
5959

6060
/** @test */
6161
public function snake_case_component_is_automatically_converted_by_make_command_on_nested_component()
6262
{
63-
Artisan::call('livewire:datatable', ['name' => 'TextManager.text_replace']);
63+
Artisan::call('make:livewire-datatable', ['name' => 'TextManager.text_replace']);
6464

6565
$this->assertTrue(File::exists($this->livewireClassesPath('TextManager/TextReplace.php')));
6666
}
@@ -79,7 +79,7 @@ public function new_component_model_name_matches_option()
7979
/** @test */
8080
public function a_component_is_not_created_with_a_reserved_class_name()
8181
{
82-
Artisan::call('livewire:datatable', ['name' => 'component']);
82+
Artisan::call('make:livewire-datatable', ['name' => 'component']);
8383

8484
$this->assertFalse(File::exists($this->livewireClassesPath('Component.php')));
8585
}

0 commit comments

Comments
 (0)