@martink8 thank you for your reply. I am trying to run the view called runchat.blade
i have takedn your comments into account and fixed my code according to them.
Now I am getting another error:
Undefined variable: userdetails (View: C:\Users\Osher\Desktop\laravel\SportsApp\resources\views\runchat.blade.php)
Trying to figure out now what to do. will update you if i am manged to succeed.
meanwhile here's my updated code:
routes.php:
<?php
Route::get('/', function ()
{
return view('welcome');
});
chatcontroller.php:
<?php namespace App\Http\Controllers;
class chatcontroller extends Controller {
Route::get('runchat','ChatController@runit');
public function __construct()
{
$this->middleware('guest');
}
public function runit ()
{
$userdetails=[
'userid'=>"osherdo@gmail.com",
'password'=>'1234'];
return view('RunChat',compact('UserDetails'));
}
}
runchat.blade.php:
<html>
<body>
<p><b> Hello. This is a chat page.</b></p>
<b> you're {{$userdetails['userid']}} </b>
</body>
</html>