I get fatal error:
Function name must be a string
When try to return $redirect()->to(blah blah blah
...
if($act=="ban"){
$ban_until = $request->input('ban_until');
if(Ragnarok::temporarilyBan($account_id,$banned_by,$ban_until,$ban_reason)){
return $redirect()->to('banlist');
}else{
return $redirect()->to('banlist')->withErrors('Failed to ban, database error');
}
}else if($act=="unban"){
if(Ragnarok::unBan($account_id,$banned_by,$ban_reason)){
return $redirect()->to('banlist');
}else{
return $redirect()->to('banlist')->withErrors('Failed to unban, database error');
}
}
Anybody face this bug?
Try removing the $
from the function as so:
redirect()->to('banlist');
PHP functions must begin with a letter or underscore, you have mistakenly added a $
to the function.
From the PHP Docs:
Function names follow the same rules as other labels in PHP. A valid function name starts with a letter or underscore, followed by any number of letters, numbers, or underscores. As a regular expression, it would be expressed thus: [a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*.
http://php.net/manual/en/functions.user-defined.php
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With