data_forget Helper for Laravel
Since Laravel version 10.15, there is a new utility function called data_forget that allows you to remove keys from an array or object using a "dot" notation.
2 min read
Tags:
Laravel Translations UI is a package that provides a simple and friendly user interface for managing translations in a Laravel app. With this package, you can easily add, edit, delete, and export translations, and use the search function to find specific translations.
? Watch a 4-minute video by Povilas Korop showcasing the package.
PHP 7.4 or higher
Laravel 8.x or higher
View, create, and delete translations
Manage translation keys
Filter by translation keys or values
Import and export translations
Search function to find specific translations
and more...
To install Laravel Translations UI in your Laravel project, run the following command:
composer require outhebox/laravel-translations
After installing the package, you'll need to publish its assets by running the following command:
php artisan translations:install
Before you can import translations, you'll need to migrate your database. Run the following command to do so:
php artisan migrate
To import your translations, run the following command:
php artisan translations:import
To import and overwrite all previous translations, use the following command:
php artisan translations:import --fresh
To access the translations UI, visit /translations in your browser. If you are using a production environment, you will need to login to your application before accessing the translations UI.
You can customize the authorization gate in the configuration file to control access to the translations UI in non-local environments. For more information, see for more details Authorization.
To export your translations, run the following command:
php artisan translations:export
By default, the Translations UI dashboard can only be accessed in the local environment. The authorization gate in the app/Providers/TranslationsServiceProvider.php
file controls access to the Translations UI dashboard in non-local environments. You can modify this gate as needed to restrict access to your Translations UI installation.
To customize the authorization gate, you can define a closure in the gate method of the TranslationsServiceProvider class:
protected function gate()
{
Gate::define('viewLaravelTranslationsUI', function ($user) {
return in_array($user->email, [
// return true or false based on your authorization logic
]);
});
}
When upgrading to a new major version of Laravel Translations UI, it's important that you carefully review the upgrade guide.
In addition, when upgrading to any new Translations UI version, you should re-publish Translations UI assets:
php artisan translations:publish
To keep the assets up-to-date and avoid issues in future updates, you may add the translations:publish command to the post-update-cmd scripts in your application's composer.json file:
{
"scripts": {
"post-update-cmd": [
"@php artisan translations:publish --ansi"
]
}
}
Full-stack developer with a knack for Merging creativity with technical expertise for standout solutions.
Since Laravel version 10.15, there is a new utility function called data_forget that allows you to remove keys from an array or object using a "dot" notation.
The ChatGPT Laravel API Package Generator package for Laravel generates smart API mocks in Laravel using ChatGPT prompts:
You can make your Laravel app multi-tenant using the Tenancy for Laravel Tenant package. This tenancy package lets you make any Laravel application multi-tenant without rewriting it.
Are you ready to take your Laravel skills to the next level and build extraordinary applications? Look no further! In this blog post, we will unveil a treasure trove of top packages that will revolutionize your development process.
The Livewire Tables package brings dynamic tables for models to Laravel Livewire. These are some of the features which you will get out of the box:
The MJML PHP package by Spatie can help you create email templates more easily. But there is a catch. It can be difficult to craft visually appealing and functional email templates that work across a variety of email clients.
Subscribe for 20+ new Laravel tutorials every week
You can unsubscribe at any time. You'll also get -20% off my courses!