mercredi 26 août 2020

issue laravel version 6.0 not able to call compact function

writing this code for routing

Route::get('/welcome', 'WelcomeController@welcome');

after that i have called to a new controller

<?php
    namespace  App\Http\Controllers;
    
    class WelcomeController extends Controller{
        
        public function welcome () {
            $data = ['name'=>'Test'];
            return view('welcome', compact(data));
        }
    }

after that i am calling this $data variable in welcome.blade.php

using this method $data['name'];

server not sending any responce



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire