rupesh rupesh - 11 months ago 105
PHP Question

How to fetch id in blade template in laravel 5.3

I want to fetch this id 9 in blade
i dont want to route it

Answer Source

in your profilecontroller your method is like this

public function profile($profile){
  // you can call model function and get data from profile id 
 //and then pass it to the view
$data["profile_info"] = "fetch the data from database call your model function "; 
 return View("your_bladefilename",$data);


you can access profile_info in your blade file using profile_info variable

in your blade file




Let me know if anything is not clear