I'm trying to use @if & @else inside a controller, eg:
public function deleteCharacter ($char_delete_id)
{
@if (Auth::user()->id == $delCharacterUserID)
$deleteSuccess = 1;
return redirect('/characters')->with('deleteSuccess', $deleteSuccess);
@else
$deleteSuccess = 0;
return redirect('/characters')->with('deleteSuccess', $deleteSuccess);
@endif
This throws the error:
FatalErrorException in CharacterController.php line 40: syntax error, unexpected 'if' (T_IF)
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2rdUH4U
via IFTTT
Aucun commentaire:
Enregistrer un commentaire