I have a taxi system, and this code gives me
<?php
namespace App\Controllers;
use Illuminate\Http\Request;
class Controller
{
public Request $request;
public array $user;
public function __construct()
{
$this->user = [];
$this->request = Request::capture();
if (key_exists('user', $_SESSION)) {
$this->user = $_SESSION['user'];
}
if (count($this->user) === 0 && url()->contains('panel')) {
return redirect(url('login-form'));
}
}
}
but the system is giving me error after writing these lines of code
ParseError
syntax error, unexpected 'Request' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)