I have a macro inside a page.
@extends('mobilemaster')
@section('content')
{{Form::macro('date', function()
{
return ' <input type="date" data-clear-btn="true" name="date-2" id="date-2" value="">';
}); }}
But now i want to use that macro on another 10 pages too. so i thought i'd place that macro code inside the mastermobile page. But when i do that laravel says: 'Method date does not exist'.
So i have to copy and paste the macro 10 times in every view i use a the date macro?
What I normally do is create a macros.php in the app folder and include it within app\start\global.php by adding
require app_path().'/macros.php';
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community