Two util functions to help keep blade partials reusable;
props()
passes on var$props
as a casted object to the partial, andreduce()
takes in an array of data and re-assigns/links keys (as seen in title), or just passes the key on as is (similar to ES6 destructuring).
— @withjacoby. (12 February 2019). https://twitter.com/withjacoby/status/1095248094214737921
@include('partials.comps.hero', App\props(
App\reduce($hero, [
'title' => 'hero_title',
'editor',
'image',
])
))