Add Contacts tests

This commit is contained in:
Jonny Barnes 2017-02-18 14:16:22 +00:00
parent b84f8278b6
commit ebb13b905f
5 changed files with 50 additions and 6 deletions

View file

@ -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'));
}
}