Skip to content

Commit 78326e6

Browse files
committed
remove publish provider & add lang folder
1 parent 9c70220 commit 78326e6

File tree

10 files changed

+65
-14
lines changed

10 files changed

+65
-14
lines changed

publish/LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) Fady Mondy
3+
Copyright (c)
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

publish/resources/lang/.gitkeep

Whitespace-only changes.

publish/resources/lang/ar.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
3+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
return [
4+
5+
];

publish/resources/lang/en.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
3+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
return [
4+
5+
];

src/Console/LaravelPackageGenerator.php

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,16 @@ public function handle()
157157
$register->push(' //Publish Config');
158158
$register->push(' $this->publishes([');
159159
$register->push(' __DIR__.\'/../config/'.$packageNamePath.'.php\' => config_path(\''.$packageNamePath.'.php\'),');
160-
$register->push(' ], \'config\');');
160+
$register->push(' ], \''.$packageNamePath.'-config\');');
161161
$register->push(" ");
162+
163+
//Generate Config file
164+
$this->generateStubs(
165+
$this->stubPath . 'config.stub',
166+
$packagePath . '/config/'.$packageNamePath.'.php',
167+
[
168+
],
169+
);
162170
}
163171
if($packageMigration === 'yes'){
164172
$register->push(' //Register Migrations');
@@ -167,7 +175,7 @@ public function handle()
167175
$register->push(' //Publish Migrations');
168176
$register->push(' $this->publishes([');
169177
$register->push(' __DIR__.\'/../database/migrations\' => database_path(\'migrations\'),');
170-
$register->push(' ], \'migrations\');');
178+
$register->push(' ], \''.$packageNamePath.'-migrations\');');
171179
}
172180
if($packageView === 'yes'){
173181
$register->push(' //Register views');
@@ -176,15 +184,15 @@ public function handle()
176184
$register->push(' //Publish Views');
177185
$register->push(' $this->publishes([');
178186
$register->push(' __DIR__.\'/../resources/views\' => resource_path(\'views/vendor/'.$packageNamePath.'\'),');
179-
$register->push(' ], \'views\');');
187+
$register->push(' ], \''.$packageNamePath.'-views\');');
180188
$register->push(" ");
181189
$register->push(' //Register Langs');
182190
$register->push(' $this->loadTranslationsFrom(__DIR__.\'/../resources/lang\', \''.$packageNamePath.'\');');
183191
$register->push(" ");
184192
$register->push(' //Publish Lang');
185193
$register->push(' $this->publishes([');
186-
$register->push(' __DIR__.\'/../resources/lang\' => resource_path(\'lang/vendor/'.$packageNamePath.'\'),');
187-
$register->push(' ], \'lang\');');
194+
$register->push(' __DIR__.\'/../resources/lang\' => app_path(\'lang/vendor/'.$packageNamePath.'\'),');
195+
$register->push(' ], \''.$packageNamePath.'-lang\');');
188196
$register->push(" ");
189197
}
190198
if($packageRoute === 'yes') {
@@ -244,9 +252,6 @@ public function handle()
244252
]
245253
);
246254

247-
248-
249-
250255
$this->info('Package boilerplate generated successfully');
251256
}
252257
}

stubs/command.stub

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ class {{ name }} extends Command
3838
{
3939
$this->info('Publish Vendor Assets');
4040
$this->callSilent('optimize:clear');
41-
$this->call('vendor:publish', ['--provider' => '{{ namespace }}\{{ provider }}']);
4241
$this->yarnCommand(['install']);
4342
$this->yarnCommand(['build']);
4443
$this->artisanCommand(["migrate"]);

stubs/config.stub

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
return [
4+
//You config go here...
5+
];

stubs/readme.stub

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,45 @@
77
```bash
88
composer require {{ vendor }}/{{ package }}
99
```
10-
your install here
10+
after install your package please run this command
1111

1212
```bash
1313
php artisan {{ command }}:install
1414
```
1515

16-
## Using
16+
## Publish Assets
1717

18-
your using here..
18+
you can publish config file by use this command
19+
20+
```bash
21+
php artisan vendor:publish --tag="{{ package }}-config"
22+
```
23+
24+
you can publish views file by use this command
25+
26+
```bash
27+
php artisan vendor:publish --tag="{{ package }}-views"
28+
```
29+
30+
you can publish languages file by use this command
31+
32+
```bash
33+
php artisan vendor:publish --tag="{{ package }}-lang"
34+
```
35+
36+
you can publish migrations file by use this command
37+
38+
```bash
39+
php artisan vendor:publish --tag="{{ package }}-migrations"
40+
```
1941

2042
## Support
2143

22-
your support link here..
44+
you can join our discord server to get support [TomatoPHP](https://discord.gg/Xqmt35Uh)
45+
46+
## Docs
47+
48+
you can check docs of this package on [Docs](https://docs.tomatophp.com/plugins/laravel-package-generator)
2349

2450
## Changelog
2551

0 commit comments

Comments
 (0)