Skip to content

Commit

Permalink
Merge pull request #142 from musimana/feature/CreateContactsConfig
Browse files Browse the repository at this point in the history
feat: Create Contacts Config
  • Loading branch information
musimana authored Jul 21, 2024
2 parents bd331b1 + 6ae7ba1 commit 1b62929
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 19 additions & 0 deletions config/contacts.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

return [

/*
|--------------------------------------------------------------------------
| Project Owner Address
|--------------------------------------------------------------------------
|
| The contact details for the project owner.
|
*/

'owner' => [
'address' => env('CONTACT_OWNER_EMAIL', 'admin@example.com'),
'name' => env('CONTACT_OWNER_NAME', 'superadmin'),
],

];
6 changes: 3 additions & 3 deletions database/seeders/UserSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
]);
}

Expand Down

0 comments on commit 1b62929

Please sign in to comment.