generated from IBEC-BOX/admin-kit-package-skeleton
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from IBEC-BOX/feat/add-more-features-and-fixes
Feat/add more features and fixes
- Loading branch information
Showing
24 changed files
with
300 additions
and
85 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,6 @@ | |
|
||
// config for AdminKit/Localizations | ||
return [ | ||
// | ||
'disk' => 'localizations', | ||
'path' => '{locale}.json', | ||
]; |
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,20 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace AdminKit\Localizations\Actions; | ||
|
||
use AdminKit\Core\Facades\AdminKit; | ||
use Illuminate\Support\Facades\Cache; | ||
|
||
class LocalizationCacheForgetAction | ||
{ | ||
public function run(): void | ||
{ | ||
Cache::forget('ak_localizations'); | ||
|
||
foreach (AdminKit::locales() as $locale) { | ||
Cache::forget("ak_localizations_$locale"); | ||
} | ||
} | ||
} |
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,40 @@ | ||
<?php | ||
|
||
namespace AdminKit\Localizations\Commands; | ||
|
||
use AdminKit\Localizations\LocalizationsServiceProvider; | ||
use Illuminate\Console\Command; | ||
|
||
class InstallCommand extends Command | ||
{ | ||
public $signature = 'admin-kit:install-localizations'; | ||
|
||
public $description = 'Install AdminKit Articles package'; | ||
|
||
public function handle(): int | ||
{ | ||
if ($this->confirm('Publishing stubs and migrations?', true)) { | ||
$this->call('vendor:publish', [ | ||
'--provider' => LocalizationsServiceProvider::class, | ||
'--tag' => 'admin-kit-localizations-stubs', | ||
]); | ||
$this->call('vendor:publish', [ | ||
'--provider' => LocalizationsServiceProvider::class, | ||
'--tag' => 'admin-kit-localizations-migrations', | ||
]); | ||
} | ||
|
||
if ($this->confirm('Migrate the database tables?', true)) { | ||
$this->call('migrate'); | ||
} | ||
|
||
if ($this->confirm('(Optional) Publishing config file?')) { | ||
$this->call('vendor:publish', [ | ||
'--provider' => LocalizationsServiceProvider::class, | ||
'--tag' => 'admin-kit-localizations-config', | ||
]); | ||
} | ||
|
||
return self::SUCCESS; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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
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
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,13 @@ | ||
<?php | ||
|
||
namespace AdminKit\Localizations\UI\API\Data; | ||
|
||
use Spatie\LaravelData\Data; | ||
|
||
class LocalizationFullData extends Data | ||
{ | ||
public function __construct( | ||
public string $key, | ||
public array $content, | ||
) {} | ||
} |
Oops, something went wrong.