From 97b1ca54d03a2974c8dfd94d5903892377fa264c Mon Sep 17 00:00:00 2001 From: Graham Aitken Date: Sun, 21 Jul 2024 22:15:16 +0100 Subject: [PATCH 1/3] Create contacts config --- config/contacts.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 config/contacts.php diff --git a/config/contacts.php b/config/contacts.php new file mode 100644 index 00000000..c1b14264 --- /dev/null +++ b/config/contacts.php @@ -0,0 +1,19 @@ + [ + 'address' => env('CONTACT_OWNER_EMAIL', 'admin@example.com'), + 'name' => env('CONTACT_OWNER_NAME', 'superadmin'), + ], + +]; From d14781c5f9a0e2fb17d3cff2dc11de109f0f0a53 Mon Sep 17 00:00:00 2001 From: Graham Aitken Date: Sun, 21 Jul 2024 22:15:49 +0100 Subject: [PATCH 2/3] Add contacts example DotEnv variables --- .env.example | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.env.example b/.env.example index 8ff34e98..392daa73 100644 --- a/.env.example +++ b/.env.example @@ -77,6 +77,11 @@ APP_IMAGE_OPEN_GRAPH="resources/img/open-graph.png" APP_LINK_PROJECT_REPO="https://github.com/musimana/bassform" APP_USER_HOMEPAGE="dashboard" +# USED FOR PROJECT CONTACTS | SEE: ./config/contacts.php + +CONTACT_OWNER_EMAIL="${MAIL_FROM_ADDRESS}" +CONTACT_OWNER_NAME="${MAIL_FROM_NAME}" + # USED TO CONTROL DUSK TEST SETTINGS | SEE: ./config/dusk.php ## FRAMEWORK DUSK TEST SETTINGS From 6ae7ba10cacae6a4679d4dad6f29e0c85ef22a6c Mon Sep 17 00:00:00 2001 From: Graham Aitken Date: Sun, 21 Jul 2024 22:16:12 +0100 Subject: [PATCH 3/3] Update UserSeeder primary user logic --- database/seeders/UserSeeder.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/database/seeders/UserSeeder.php b/database/seeders/UserSeeder.php index 853f461b..6b244600 100644 --- a/database/seeders/UserSeeder.php +++ b/database/seeders/UserSeeder.php @@ -10,12 +10,12 @@ final class UserSeeder extends Seeder /** Run the database seeds. */ public function run(): void { - $primary_user = User::where([['email', config('mail.from.address')]])->first(); + $primary_user = User::where([['email', config('contacts.owner.address')]])->first(); if (!$primary_user) { User::factory()->isAdmin()->create([ - 'name' => config('mail.from.name', 'admin'), - 'email' => config('mail.from.address', 'admin@example.com'), + 'name' => config('contacts.owner.name'), + 'email' => config('contacts.owner.address'), ]); }