Pass variable by controller

Posted 1 year ago by LuisFelipe

Can not find variable, error: Variable undefined

Controller:

<?php

namespace App\Http\Controllers\Mock;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class RecebimentoController extends Controller
{
    /*
     * Dashboard
     * */
    public function dashboard(Request $request)
    {
        return view('pages.recebimento.dashboard');
        $aguardandoRecebimento = 21;
        $aguardandoAvaliacao = 126;
        $aguardandoAprovacao = 6;
        $aguardandoExecucao = 121;
    }
}

Print:

<h1 class="font-light">20  {{$aguardandoRecebimento ?? 22}} </h1>

Routes:

Route::get('/dashboard', 'Mock\[email protected]') >name('recebimento.dashboard');

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.