Skip to content

Commit

Permalink
Support Laravel 9 and 10
Browse files Browse the repository at this point in the history
  • Loading branch information
HasanAlyazidi committed Mar 28, 2023
1 parent bdad183 commit 0102dd7
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 10 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,22 @@

## Install

1. Add package to your `composer.json`

```bash
composer require hasanalyazidi/laravel-sendables
```

2. Migrate package tables or publish migrations first then migrate

```bash
php artisan migrate
```

---

## Publish package files

### Publish config file (Required)

```bash
Expand Down
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@
"email": "[email protected]"
}
],
"minimum-stability": "dev",
"minimum-stability": "stable",
"prefer-stable":true,
"require": {
"php": ">=7.1",
"php": ">=7.1|^8.0",
"guzzlehttp/guzzle": "^7.3",
"illuminate/contracts": "^6|^7|^8|^9",
"illuminate/support": "^6|^7|^8|^9"
"illuminate/contracts": "^6|^7|^8|^9|^10",
"illuminate/support": "^6|^7|^8|^9|^10"
},
"require-dev": {
"laravel/framework": "^6|^7|^8",
"phpunit/phpunit": "^6|^7|^8|^9",
"laravel/framework": "^6|^7|^8|^9|^10",
"phpunit/phpunit": "^6|^7|^8|^9|^10",
"orchestra/testbench": "^6.0"
},
"autoload": {
Expand Down
File renamed without changes.
File renamed without changes.
15 changes: 11 additions & 4 deletions src/Providers/SendablesServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace HasanAlyazidi\Sendables\Providers;

use HasanAlyazidi\Sendables\SendablesFacade;
use Illuminate\Support\Facades\File;
use Illuminate\Support\ServiceProvider;

class SendablesServiceProvider extends ServiceProvider
Expand All @@ -18,7 +19,7 @@ public function boot()

$this->loadMigrationsFrom(__DIR__.'/../../database/migrations');

$this->loadTranslationsFrom(__DIR__.'/../../resources/lang', 'sendables');
$this->loadTranslationsFrom(__DIR__.'/../../lang', 'sendables');

$this->publishAll();
}
Expand Down Expand Up @@ -58,16 +59,22 @@ public function publishAll()

private function publishTranslations()
{
$isLangFolderInResources = File::isDirectory(resource_path('lang'));

$langBasePath = $isLangFolderInResources
? resource_path()
: base_path();

$this->publishes([
__DIR__.'/../../resources/lang/' => resource_path('lang/vendor/sendables')
__DIR__.'/../../lang/' => $langBasePath.'/lang/vendor/sendables'
], 'resources-lang-all');

$this->publishes([
__DIR__.'/../../resources/lang/ar/' => resource_path('lang/vendor/sendables/ar')
__DIR__.'/../../lang/ar/' => $langBasePath.'/lang/vendor/sendables/ar'
], 'resources-lang-ar');

$this->publishes([
__DIR__.'/../../resources/lang/en/' => resource_path('lang/vendor/sendables/en')
__DIR__.'/../../lang/en/' => $langBasePath.'/lang/vendor/sendables/en'
], 'resources-lang-en');
}
}

0 comments on commit 0102dd7

Please sign in to comment.