语法错误,意外'如果'(T_IF),期待']'可以有人帮助我,我被卡住了 [英] Syntax error, unexpected 'if' (T_IF), expecting ']' can someone help me I am stuck

查看:89
本文介绍了语法错误,意外'如果'(T_IF),期待']'可以有人帮助我,我被卡住了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,我想编写一个查询,当你点击登录时会检查余额,它会显示一条有你余额的信息,但是如果你没有余额,它将允许你登录laravel .Below就是我所拥有的试过。余额清单在另一张名为违约者的表格中。



我尝试过:



受保护的函数validateLogin(请求$请求)
{
//SELECT * from defaulters where myPIN =>'$ myPIN'
// union
$ defaulters = Defaulters_Reg :: select('Debt_amount') - > where('myPIN',$ id) - > get();
$ request-> validate([
'myPIN'=>'required | myPIN',
'Endt_amount'=>'required | string'
if($ validateLogin-> failed())
{
返回Redirect :: to('login')
}
])

$ request-> ;验证([
$ this-> username()=>'required | string',
'password'=>'required | string',
]);
}

解决方案

request)
{
//SELECT * from违约者,其中myPIN =>'


myPIN'
// union


defaulters = Defaulters_Reg :: select('Debt_amount') - 化合物其中( 'myPIN',

hey i want to write a query that will check for balance when you click login and it will show a message that has your balance but if you dont have a balance it will allow you to login in laravel .Below is what i have tried.the list of balance is in another table called defaulters.

What I have tried:

protected function validateLogin(Request $request)
 {
     // "SELECT * from defaulters where myPIN => '$myPIN'"
     // union
     $defaulters = Defaulters_Reg::select('Debt_amount')->where('myPIN',$id)->get();
     $request->validate([
         'myPIN' => 'required|myPIN',
         'Debt_amount' => 'required|string'
         if ($validateLogin->fails())
         {
             return Redirect::to ('login')
         }
     ])

     $request->validate([
         $this->username() => 'required|string',
         'password' => 'required|string',
     ]);
 }

解决方案

request) { // "SELECT * from defaulters where myPIN => '


myPIN'" // union


defaulters = Defaulters_Reg::select('Debt_amount')->where('myPIN',


这篇关于语法错误,意外'如果'(T_IF),期待']'可以有人帮助我,我被卡住了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆