php - Laravel 7 variable not passed to view
Get the solution ↓↓↓I have a strange error:
i pass a simple var from controller to view like this:
namespace App\Http\Controllers\BE;
class User extends Controller
{
// some stuff here
public function sendPasswordReminder(Request $request) {
return response()
->view('BE.user.passwordreset', ['name' => 'James'], 200);
// very simple, nothing special here, also tried return view() stuff
}
}
and an absolutly basic blade:
@extends('BE.templates.main')
@section('content')
{{ $name }}
@endsection
and i get the response
Facade\Ignition\Exceptions\ViewException
Undefined variable: name (View: /Users/modii/Work/l7/distr/resources/views/BE/user/passwordreset.blade.php)
i ended up with this absolute basic version while trying to figure out what is wrong. this should be very basic. its not working. tried to clear cache both with artisan and manually. no result.
i have NO IDEA what could be wrong. If anyone has an idea...
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: your lock file does not contain a compatible set of packages. please run composer update
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.