]> _ Git - pmi.git/commitdiff
wip #6033 @3:00 modifications du template mail (traductions, css, ...)
authorsoufiane <soufiane@cubedesigners.com>
Thu, 15 Jun 2023 13:09:47 +0000 (15:09 +0200)
committersoufiane <soufiane@cubedesigners.com>
Thu, 15 Jun 2023 13:09:47 +0000 (15:09 +0200)
app/Models/AuthClient.php
app/Models/ClientUser.php [new file with mode: 0644]
app/User.php
resources/fr.json [new file with mode: 0644]
resources/js/app.js
resources/lang/en/auth.php
resources/lang/en/mail.php [new file with mode: 0644]
resources/lang/fr/auth.php

index 08e74947d7d0f6e52716e483e1201b14519782b3..ea0018915114cf70890f02054bd8d1b3bc30c257 100644 (file)
@@ -1,11 +1,13 @@
 <?php
 namespace App\Models;
 
+use Backpack\Base\app\Notifications\ResetPasswordNotification as ResetPasswordNotification;
 use Illuminate\Auth\Passwords\CanResetPassword;
 use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
 use Illuminate\Foundation\Auth\User as Authenticatable;
 use Illuminate\Notifications\Notifiable;
 
+
 class AuthClient extends Authenticatable implements CanResetPasswordContract
 {
 
@@ -31,4 +33,9 @@ class AuthClient extends Authenticatable implements CanResetPasswordContract
     protected $hidden = [
         'remember_token',
     ];
+
+    public function sendPasswordResetNotification($token)
+    {
+        $this->notify((new ResetPasswordNotification($token))->locale('fr'));
+    }
 }
diff --git a/app/Models/ClientUser.php b/app/Models/ClientUser.php
new file mode 100644 (file)
index 0000000..1cef4c0
--- /dev/null
@@ -0,0 +1,36 @@
+<?php
+
+namespace App\Models;
+
+use App\User;
+use Backpack\Base\app\Models\Traits\InheritsRelationsFromParentModel;
+use Backpack\Base\app\Notifications\ResetPasswordNotification as ResetPasswordNotification;
+
+class ClientUser extends User
+{
+    use InheritsRelationsFromParentModel;
+
+    protected $table = 'clients';
+
+    /**
+     * Send the password reset notification.
+     *
+     * @param string $token
+     *
+     * @return void
+     */
+    public function sendPasswordResetNotification($token)
+    {
+        $this->notify((new ResetPasswordNotification($token))->locale('fr'));
+    }
+
+    /**
+     * Get the e-mail address where password reset links are sent.
+     *
+     * @return string
+     */
+    public function getEmailForPasswordReset()
+    {
+        return $this->email;
+    }
+}
index 9f56799af95669a114a25583578d94d4892873bb..f631dea36f3bf880c076a7ac3f577bf842ee76a8 100644 (file)
@@ -2,11 +2,12 @@
 
 namespace App;
 
+use Backpack\Base\app\Notifications\ResetPasswordNotification as ResetPasswordNotification;
 use Illuminate\Notifications\Notifiable;
-use Illuminate\Contracts\Auth\MustVerifyEmail;
 use Illuminate\Foundation\Auth\User as Authenticatable;
 use Backpack\CRUD\CrudTrait;
 use Spatie\Permission\Traits\HasRoles;
+use Cubist\Backpack\Facades\App;
 
 class User extends Authenticatable
 {
@@ -31,4 +32,10 @@ class User extends Authenticatable
     protected $hidden = [
         'password', 'remember_token',
     ];
+
+    public function sendPasswordResetNotification($token)
+    {
+        $this->notify((new ResetPasswordNotification($token))->locale(App::getLocale()));
+    }
+
 }
diff --git a/resources/fr.json b/resources/fr.json
new file mode 100644 (file)
index 0000000..979adea
--- /dev/null
@@ -0,0 +1,3 @@
+{
+    "name": "John Doe"
+}
index eaed7d9e7814b1be054dbf20dbeed1febd20f849..a24da2ce422fd1f83df23d0482ab1e8b918a316f 100644 (file)
@@ -123,7 +123,7 @@ const app = new Vue({
         this.price = parseFloat(this.$refs.optprice ?.dataset.default).toFixed(2)
         this.statusText = this.$refs.statusConfig ?.dataset.incomplete
         this.discount = this.$refs.discount ?.dataset.value
-        this.validateAction = this.$refs.forgotpwd ?.dataset.status
+        this.validateAction = this.$refs.forgotpwd ?.dataset.status //specific code for the forgot password confirmation
     },
 
     watch: {
index e5506df2907a7c8f63f3841a918611b93d67e84e..4e7409fb59f10142d4626f3e7ed0130a37730fc7 100644 (file)
@@ -15,5 +15,4 @@ return [
 
     'failed' => 'These credentials do not match our records.',
     'throttle' => 'Too many login attempts. Please try again in :seconds seconds.',
-
 ];
diff --git a/resources/lang/en/mail.php b/resources/lang/en/mail.php
new file mode 100644 (file)
index 0000000..a4e8d4d
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+
+return [
+    'regards' => 'Regards',
+    'footer_part1' => 'If you’re having trouble clicking the',
+    'footer_part2' => 'button, copy and paste the URL below',
+    'footer_part3' => ' into your web browser:<br>',
+];
index fa8f772f6a12fad7a31bd12e65ea59f927a3dba6..d2e3c2cd120b55399cd3aa3833a505b350ffd1c7 100644 (file)
@@ -15,5 +15,4 @@ return [
 
     'failed' => 'Ces identifiants s',
     'throttle' => 'Trop de tentatives. Veuillez patienter :seconds secondes.',
-
 ];