刀片服务器中的laravel 7路由/url参数

刀片服务器中的laravel 7路由/url参数,laravel,laravel-blade,laravel-7,Laravel,Laravel Blade,Laravel 7,我试图通过GET请求将参数type=Business传递给 注册执行 @if (Route::has('register')) <a href="register?type=Business">Register Business</a> <a href="register?type=Applicant">Register Applicant</a> @endif 欢

我试图通过GET请求将参数type=Business传递给 注册执行

     @if (Route::has('register'))
     <a href="register?type=Business">Register Business</a>
     <a href="register?type=Applicant">Register Applicant</a>
     @endif
  • 欢迎光临

  • 我有两个链接要注册

         @if (Route::has('register'))
         <a href="register?type=Business">Register Business</a>
         <a href="register?type=Applicant">Register Applicant</a>
         @endif
    
  • 返回视图('网站::欢迎'

  • 意思是说我有自己的包叫做“网站”

Q) 我遗漏了什么,我的代码出了什么问题

我从RegisterPerform收到错误信息:

解析错误
语法错误,意外的“$type”(T_变量),应为“,”或“)”(视图:register.blade.php)

错误来自下面的这一行

 @if (isset($type == 'Business'))
您需要调用以下两个条件。对于
isset
比较

@if (isset($type) && $type== 'Business')

您在哪里定义了
$type
?您定义了
$userTypes
而不是
$type
,因此
$type
是未定义的,而且您的
$userTypes
是一个数组类型,通过GET参数来自url。类型=业务。三年前的答案是成功,解决了我的问题。
 @if (isset($type == 'Business'))
@if (isset($type) && $type== 'Business')