Skip to content

Instantly share code, notes, and snippets.

@kpbowler
Last active October 5, 2018 09:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kpbowler/38e0bcaf955256657cfbc154adc6ad08 to your computer and use it in GitHub Desktop.
Save kpbowler/38e0bcaf955256657cfbc154adc6ad08 to your computer and use it in GitHub Desktop.
Getting data from model into view
<?php namespace App\Http\Controllers;
class TestController extends Controller {
public function show($id) {
$contact = Contact::find($id);
$name = $contact->fullname;
return view('path.to.view.file.', compact('name'));
}
}
<div>
Name: {{ $name }}
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment