Laravel View Composer "Use of undefined constant"
Use $links
, not links
:
@section('content')
All the stuff!
{{ $links }}
@stop
Every variable in PHP should be preceded by a $
sign. If there's no $
, PHP treats it as a constant.
It's just a simple syntax issue, everything you send to a view is a php variable so still needs to be referenced with the $
In your view, you are referencing links
without the dollar sign.
If you update it to:
{{ $links }}
You'll be A-OK