1. Go to this page and download the library: Download kenepa/translation-manager library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Kenepa\TranslationManager\TranslationManagerPlugin;
use Filament\Panel;
class AdminPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
// ...
->plugin(TranslationManagerPlugin::make());
}
}
// app/Providers/AppServiceProvider.php
use Illuminate\Support\Facades\Gate;
/**
* Bootstrap any application services.
*/
public function boot(): void
{
Gate::define('use-translation-manager', function (?User $user) {
// Your authorization logic
return $user !== null && $user->hasRole('admin');
});
}