-
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
90 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
namespace Cone\Bazar\Listeners; | ||
|
||
use Illuminate\Foundation\Events\VendorTagPublished; | ||
use Illuminate\Support\Facades\App; | ||
|
||
class FormatBazarStubs | ||
{ | ||
/** | ||
* Handle the event. | ||
*/ | ||
public function handle(VendorTagPublished $event): void | ||
{ | ||
if ($event->tag === 'bazar-stubs') { | ||
foreach ($event->paths as $from => $to) { | ||
$contents = file_get_contents($to); | ||
|
||
$contents = str_replace('{{ namespace }}', App::getNamespace(), $contents); | ||
|
||
file_put_contents($to, $contents); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
namespace {{ namespace }}Providers; | ||
|
||
use {{ namespace }}Root\Resources\CategoryResource; | ||
use {{ namespace }}Root\Resources\OrderResource; | ||
use {{ namespace }}Root\Resources\ProductResource; | ||
use {{ namespace }}Root\Resources\PropertyResource; | ||
use Cone\Root\Root; | ||
use Illuminate\Support\ServiceProvider; | ||
|
||
class BazarServiceProvider extends ServiceProvider | ||
{ | ||
/** | ||
* All of the container bindings that should be registered. | ||
*/ | ||
public array $bindings = [ | ||
// | ||
]; | ||
|
||
/** | ||
* Register any application services. | ||
*/ | ||
public function register(): void | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Bootstrap any application services. | ||
*/ | ||
public function boot(): void | ||
{ | ||
Root::instance()->resources->register([ | ||
new CategoryResource(), | ||
new ProductResource(), | ||
new PropertyResource(), | ||
new OrderResource(), | ||
]); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
src/Resources/CategoryResource.php → stubs/CategoryResource.stub
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/Resources/PropertyResource.php → stubs/PropertyResource.stub
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters