Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
joserick committed Jan 25, 2024
1 parent d030c39 commit 6e4a023
Show file tree
Hide file tree
Showing 9 changed files with 8,697 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/vendor/
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Laravel Livewire Discover

Discover and autoload multiples namespace for livewire components.

## Installation

You can install the package via composer:

``` bash
composer require joserick/laravel-livewire-discover
```
## Use
Add to *AppServiceProvider.php*
``` php
public function boot(): void
{
// Load multiples namespace for Livewire components.
Livewire::discover('Namespace\\Livewire', 'my-components');
Livewire::discover('User\\Repository\\Livewire', 'new-components');
...
}
```
#### Or
Or use the config: *'config/laravel-livewire-discover.php'*
``` bash
# Publish the config
php artisan vendor:publish --tag livewire-discover-config
```
``` php
// Load the namespace to Livewire components.
'class_namespaces' => [
// 'prefix' => '//namespace//',
'my-components' => 'Namespace\\Livewire',
'new-components' => 'User\\Repository\\Livewire',
],
```

## License

The GNU Public License (GPLv3). Please see [License File](https://github.com/joserick/laravel-livewire-discover/blob/master/LICENSE) for more information.

35 changes: 35 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "joserick/laravel-livewire-discover",
"description": "Discover and autoload multiples components of livewire by convention (componentNamespace)",
"type": "package",
"authors": [
{
"name": "joserick",
"email": "support@joserick.com",
"role": "Developer"
}
],
"license": "GPL-3.0-or-later",
"require": {
"spatie/laravel-package-tools": "^1.16",
"livewire/livewire": "^3.0"
},
"require-dev": {
"orchestra/testbench": "^8.5"
},
"autoload": {
"psr-4": {
"Joserick\\LaravelLivewireDiscover\\": "src/"
}
},
"extra": {
"laravel": {
"providers": [
"Joserick\\LaravelLivewireDiscover\\LaravelLivewireDiscoverServiceProvider"
],
"aliases": {
"LaravelLivewireDiscover": "Joserick\\LaravelLivewireDiscover\\Facades\\LaravelLivewireDiscover"
}
}
}
}
Loading

0 comments on commit 6e4a023

Please sign in to comment.