It might just be me coming from a more restricted java background, but I'm feeling the connection between views and controllers in Laravel is error prone. For example, consider a controller looking something like this
ReceiptController extends BaseController {
...
public function show() {
$data = array($receipt, $offer);
View::make('registration', $data);
}
}
and a view which depends on a receipt object and an offer string
...
<div id="receipt">
<h1>Receipt</h1>
{{$receipt->items}}
@if ($receipt->price > 10000)
<p>{{$offer}}</p>
@endif;
</div>
...
What if a controller somewhere don't include the offer string? Worst case scenario it might go unnoticed until someone purchase something with a price over 10000. How would I go about throwing an error if the controller doesn't pass all variables required to make the view? Bonus if it also makes an IDE such as PHPStorm recognize the variables.