The code in the vendor folder is in a trait, so you can override it locally - but you will need to keep the same method name
How to change the return views of core files without editing the core files?
Hello,
I am having a problem and I am not 100% sure on how I should resolve it. I have a mobile app in which I need to show my laravel pages without a header and a footer, for this, I created a new layout main template and use it on all my new mobile pages. I have managed to create all my new pages without problem(register, login...) but I struggle with the "Reset password" page, I now have 2 views here:
views/auth/password/reset.blade.php
and
views/auth/password/mobile-reset.blade.php
I need to show views/auth/password/mobile-reset.blade.php in my mobile version.
I added this to my web.php routes:
Route::get('password/mobile-reset', 'Auth\MobileResetPasswordController@showLinkResetForm');
And created a new controller called: MobileResetPasswordController.php, copied all the content of ResetPasswordController.php into it but here is the problem...
I was expecting to see a "return" to a view in this file but instead, the code goes and fetch the methods here:
use Illuminate\Foundation\Auth\ResetsPasswords;
This method is the one I need to keep and create a double of it for my mobile version as:
public function showResetForm(Request $request, $token = null)
{
return view('auth.passwords.reset')->with(
['token' => $token, 'email' => $request->email]
);
}
I would like to have:
public function MobileShowResetForm(Request $request, $token = null)
{
return view('auth.passwords.mobile-reset')->with(
['token' => $token, 'email' => $request->email]
);
}
But how to do this please?
For sure I will not touch the core files in the vendor directory, what else can I do please?
Would you have an example on how create more methods based on the ones that are in th vendor directly please?
Thank you so much!
Please or to participate in this conversation.