Added: language to User profile (DB)

The language were set only on session. But now it is
stored with user profile, on DB.

It is important as now I can send alert e-mails to each
user on their own languages and not the activer
user language.

Also, wherever the user logs out and logs in again,
it will see the same site locale.
This commit is contained in:
2018-10-02 23:53:35 -03:00
parent 8157a183c7
commit 954820f46b
8 changed files with 193 additions and 16 deletions

View File

@@ -2,12 +2,13 @@
namespace App\Providers;
use App\Events\ReturnItem;
use App\Listeners\SetLanguage;
use App\Listeners\AlertReturnedItem;
use Illuminate\Support\Facades\Event;
use Illuminate\Auth\Events\Registered;
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use App\Events\ReturnItem;
use App\Listeners\AlertReturnedItem;
class EventServiceProvider extends ServiceProvider
{
@@ -24,6 +25,10 @@ class EventServiceProvider extends ServiceProvider
ReturnItem::class => [
AlertReturnedItem::class,
],
'Illuminate\Auth\Events\Login' => [
SetLanguage::class,
],
];
/**