the-riptide/laravel-dynamic-text

A setup and dashboard to make text and translations easy to edit

v0.2.8 2022-07-29 19:03 UTC

This package is auto-updated.

Last update: 2024-09-09 00:12:02 UTC


README

This package is meant to make it possible to quickly and easily turn snippets of texts, like headlines, descriptions and button texts editable via the dashboard.

to require the package run:

php composer require the-riptide/laravel-dynamic-texts

to set up the package, first go to your config app file and make sure 'locale' is set to the locale you'll be using in your project. This is important to do now, as the name of the locale will be attached to the new 'texts' table.

This done, run

php artisan language:setup

You can now have access to the special inline helper on the front. Under the hood, this makes use of Laravel's trans feature.

To use it, simply put __i('category.key', 'string you'd like to put in the database')

Then hit your page on the front and the string will be loaded into the database. Note, once the string is in the database with that category and key, it will stay there. This means, you can safetly remove the second string.

To access the database table first publish the config file

php artisan vendor:publish

and select this package from the list.

in the config file put the email you're going to use to access the dashboard. Then log in and hit the route

/dashboard/texts/edit

All your dynamic strings should appear here.

debuging

If you haven't yet used livewire in your project it's possible livewire will blow up. In that case, try adding the folder Livewire to app/Http folder. Nothing needs to be in it.