fix: Move calls to env() out of UsersTableSeeder

env() calls should be made *only* from within config files.

Note that the 'owner-username' is not prepended with 'default-' because,
unlike the other two values, it should not be changed after
installation, specifically because the account should always be
looked-up by username and not ID (despite existing code that currently
does the latter).
This commit is contained in:
Ben Johnson
2020-03-03 21:04:26 -05:00
parent d4787763d0
commit 016f948687
3 changed files with 20 additions and 7 deletions
+1 -1
View File
@@ -40,7 +40,7 @@ class ContactController extends Controller
public function store(Request $request)
{
// Fetch owner account
$user = User::where('id', '=', 3)->first();
$user = User::where('username', config('unit3d.owner-username'))->first();
$input = $request->all();
Mail::to($user->email, $user->username)->send(new Contact($input));