Ad
How To Pass The Custom Variables From ResetPasswordController To Reset Blade
How to pass the custom variables from ResetPasswordController to reset blade template.
ResetPasswordController.php
public function showResetForm(Request $request, $token = null)
{
$data = array(
'title'=>'Reset password',
'description'=> 'Reset password to abc.com',
'seo_keywords'=> 'Reset password to abc.com',
);
return view('auth/password/reset',$data);
}
Ad
Answer
By returning a view()
, the second argument can be used to pass variables to the blade template (just like you have done)
public function showResetForm(Request $request, $token = null)
{
return view('auth/password/reset',[
'title' =>'Reset password',
'description' => 'Reset password to abc.com',
'seo_keywords' => 'Reset password to abc.com',
]);
}
These would then be accessable as {{ $title }}
, {{ $description}}
, {{ $seo_keywords}}
.
If you are unable to retrieve these, it may be because you are editting the wrong blade template. The default template is located at auth.passwords.reset
(resources/views/auth/passwords/reset.blade.php
).
I'd suggest just adding a {{ dd('here) }}
at the top of that template to make sure it is in fact the template being used by your application!
Ad
source: stackoverflow.com
Related Questions
- → "failed to open stream" error when executing "migrate:make"
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS - Conditionally Load a Different Page
- → Make a Laravel collection into angular array (octobercms)
- → In OctoberCMS how do you find the hint path?
- → How to register middlewares in OctoberCMS plugin?
- → Validating fileupload(image Dimensions) in Backend Octobercms
- → OctoberCMS Fileupload completely destroys my backend
- → How do I call the value from another backed page form and use it on a component in OctoberCms
Ad