mercredi 31 mars 2021

I call Controller and view through route first time but it show error like this [closed]

home.php //controller

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class home extends Controller
{
    
   public function index($home)
    {
        return view('home',['home'=>$home]);

    }
}

web.php

Route::get('home/{home}',[home::class,'index']);

home.blade.php

  

ErrorException

Use of undefined constant home - assumed 'home' (this will throw an Error in a future version of PHP) (View: C:\Users\RASHEED1612E\project\resources\views\home.blade.php)



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire