Add Contacts tests
This commit is contained in:
parent
b84f8278b6
commit
ebb13b905f
5 changed files with 50 additions and 6 deletions
|
@ -39,11 +39,11 @@ class ContactsController extends Controller
|
|||
$contact = Contact::where('nick', '=', $nick)->firstOrFail();
|
||||
$contact->homepageHost = parse_url($contact->homepage, PHP_URL_HOST);
|
||||
$file = public_path() . '/assets/profile-images/' . $contact->homepageHost . '/image';
|
||||
$contact->image = ($filesystem->exists($file)) ?
|
||||
$image = ($filesystem->exists($file)) ?
|
||||
'/assets/profile-images/' . $contact->homepageHost . '/image'
|
||||
:
|
||||
'/assets/profile-images/default-image';
|
||||
|
||||
return view('contacts.show', ['contact' => $contact]);
|
||||
return view('contacts.show', compact('contact', 'image'));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue