From d9b415e2667d39363c1a3815461aba66a757f1ec Mon Sep 17 00:00:00 2001 From: Sam Poyigi <6567634+sampoyigi@users.noreply.github.com> Date: Wed, 19 Jun 2024 15:40:03 +0100 Subject: [PATCH] Code refactor Signed-off-by: Sam Poyigi <6567634+sampoyigi@users.noreply.github.com> --- src/Database/Factories/CustomerFactory.php | 1 + src/Models/Customer.php | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/Database/Factories/CustomerFactory.php b/src/Database/Factories/CustomerFactory.php index 2e5abb9..1ba8cb8 100644 --- a/src/Database/Factories/CustomerFactory.php +++ b/src/Database/Factories/CustomerFactory.php @@ -14,6 +14,7 @@ public function definition(): array 'first_name' => $this->faker->firstName(), 'last_name' => $this->faker->lastName(), 'email' => $this->faker->email(), + 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password 'telephone' => $this->faker->phoneNumber(), 'newsletter' => $this->faker->boolean(), 'address_id' => $this->faker->numberBetween(1, 9999), diff --git a/src/Models/Customer.php b/src/Models/Customer.php index 8b5f389..1fc8e04 100644 --- a/src/Models/Customer.php +++ b/src/Models/Customer.php @@ -69,6 +69,10 @@ class Customer extends AuthUserModel 'reset_time' => 'datetime', ]; + protected $attributes = [ + 'last_location_area' => '', + ]; + public static function getDropdownOptions() { return static::whereIsEnabled()->selectRaw('customer_id, concat(first_name, " ", last_name) as name')->dropdown('name');