cms-laravel
cms-laravel copied to clipboard
Implement multilingual content management
Purpose
This pull request introduces a multilingual content management system for the CMS-Laravel application. It allows users to create, translate, and manage content in multiple languages.
Description
The key changes in this pull request are:
-
Database Schema Changes:
- Added a
languagestable to store language information, including the language name, code, and active status. - Updated the
contentstable to include alanguage_codecolumn and atranslation_group_idcolumn to support content translations. - Added a unique constraint on the
content_titleandlanguage_codecolumns in thecontentstable to ensure unique content titles per language.
- Added a
-
Model Changes:
- Updated the
Contentmodel to include the new database columns and relationships for language and translations. - Added a
Languagemodel to manage language-related data.
- Updated the
-
Filament Resource Changes:
- Updated the
ContentResourceto include a language filter, a "Translate" action, and additional form fields to manage content in multiple languages. - Added a new
LanguageResourceto manage the available languages in the application.
- Updated the
-
Livewire Component:
- Added a
LanguageSwitcherLivewire component to allow users to switch the application's language.
- Added a
Summary
The key changes in this pull request are:
database/migrations/2023_10_26_164941_create_contents_table.php: Added new columns and constraints to thecontentstable to support multilingual content.database/migrations/2023_11_01_000000_create_languages_table.php: Created a newlanguagestable to store language information.app/Models/Content.php: Updated theContentmodel to include language-related functionality.app/Models/Language.php: Added a newLanguagemodel to manage language data.app/Filament/App/Resources/ContentResource.php: Updated theContentResourceto include language-related features.app/Filament/App/Resources/LanguageResource.php: Added a newLanguageResourceto manage available languages.app/Http/Livewire/LanguageSwitcher.php: Added a new Livewire component to allow users to switch the application's language.
Suggested changes from Sweep Chat by @curtisdelicata. Continue chatting at https://sweep-chat-demo.vercel.app/c/74b23fb2-cdff-4528-bcaf-91aa76046696.