more clean up

This commit is contained in:
Cody Seibert 2024-06-07 22:05:42 -04:00
parent 780a3b1827
commit 5ec517e3bc

View File

@ -1,7 +1,11 @@
<?php
$isLocal = env('APP_ENV') === 'local';
$name = old('name') != '' ? old('name') : ($isLocal ? 'test3 normal user' : '');
$email = old('email') != '' ? old('email') : ($isLocal ? 'test3@example.com' : '');
function getOldOrLocal($key, $localValue)
{
return old($key) != '' ? old($key) : (app()->environment('local') ? $localValue : '');
}
$name = getOldOrLocal('name', 'test3 normal user');
$email = getOldOrLocal('email', 'test3@example.com');
?>
<x-layout-simple>