If statement not presenting the else resultmysql_fetch_array()/mysql_fetch_assoc()/mysql_fetch_row()/mysql_num_rows etc… expects parameter 1 to be resource or resultClient Credit Management with IF and ELSE statementIn Laravel, the best way to pass different types of flash messages in the sessionCSRF (Cross Site Request Forgery) does not work as expected in LaravelLaravel 5.3 Form post error session store not set on requestLaravel - Display form results on the same page after mutliple forms submitWhy is my validation on my Laravel form failing and routing to a different page?Put if conditions in route laravelDynamic form not sending all valuesHow to insert/post data in laravel using ajax into Database by query builder method without using model
Draw the ☣ (Biohazard Symbol)
Professor refuses to write a recommendation letter to students who haven't written a research paper with him
Why did Boris Johnson call for new elections?
Are there mathematical concepts that exist in the fourth dimension, but not in the third dimension?
Does POSIX guarantee the paths to any standard utilities?
Is the Levitate spell supposed to basically disable a melee-based enemy?
How does the UK House of Commons think they can prolong the deadline of Brexit?
What fraction of 2x2 USA call signs are vanity calls?
Undefined Hamiltonian for this particular Lagrangian
Is there any reason to change the ISO manually?
Fantasy Military Arms and Armor: the Dwarven Grand Armory
French equivalent of "my cup of tea"
What quests do you need to stop at before you make an enemy of a faction for each faction?
What's the eccentricity of an orbit (trajectory) falling straight down towards the center?
Regex pattern matching cursor-position
RAW, Is the "Finesse" trait incompatible with unarmed attacks?
Was "The Hobbit" ever abridged?
Why there are construction cranes on apparently completed buildings in New York?
Is a paralyzed creature limp or rigid?
Do I have to rename all creatures in a new world?
If I sell my PS4 game disc and buy a digital version, can I still access my saved game?
Bidirectional Dictionary
How can I oppose my advisor granting gift authorship to a collaborator?
Dissuading my girlfriend from a scam
If statement not presenting the else result
mysql_fetch_array()/mysql_fetch_assoc()/mysql_fetch_row()/mysql_num_rows etc… expects parameter 1 to be resource or resultClient Credit Management with IF and ELSE statementIn Laravel, the best way to pass different types of flash messages in the sessionCSRF (Cross Site Request Forgery) does not work as expected in LaravelLaravel 5.3 Form post error session store not set on requestLaravel - Display form results on the same page after mutliple forms submitWhy is my validation on my Laravel form failing and routing to a different page?Put if conditions in route laravelDynamic form not sending all valuesHow to insert/post data in laravel using ajax into Database by query builder method without using model
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
The else section of my code is not being displayed in my laravel blade. I need to get the else section of the statement to show. currently, that button is missing when the if statement is false.
@auth
@if(optional($quote->userLike))
@foreach($quote->userLike as $like)
@if($like->pivot->user_id == $id) //passing user id from controller here
<li class="list-inline-item">
<form method="POST" action="route('likequote')" class="likequote">
@csrf
<input type="hidden" class="form-control col-md-4" name="likequote" id="likequote" value='$quote->id'>
<button type="submit" class="btn btn-danger shadow-lg " id="savelike"><i class="fas fa-heart"></button></i>
</form>
</li>
@endif
@endforeach
@else
<li class="list-inline-item">
<form method="POST" action="route('likequote')" class="likequote">
@csrf
<input type="hidden" class="form-control col-md-4" name="likequote" id="likequote" value='$quote->id'>
<button type="submit" class="btn btn-primary shadow-lg " id="savelike"><i class="fas fa-heart"></button></i>
</form>
</li>
@endif
@endauth
php laravel laravel-5
add a comment |
The else section of my code is not being displayed in my laravel blade. I need to get the else section of the statement to show. currently, that button is missing when the if statement is false.
@auth
@if(optional($quote->userLike))
@foreach($quote->userLike as $like)
@if($like->pivot->user_id == $id) //passing user id from controller here
<li class="list-inline-item">
<form method="POST" action="route('likequote')" class="likequote">
@csrf
<input type="hidden" class="form-control col-md-4" name="likequote" id="likequote" value='$quote->id'>
<button type="submit" class="btn btn-danger shadow-lg " id="savelike"><i class="fas fa-heart"></button></i>
</form>
</li>
@endif
@endforeach
@else
<li class="list-inline-item">
<form method="POST" action="route('likequote')" class="likequote">
@csrf
<input type="hidden" class="form-control col-md-4" name="likequote" id="likequote" value='$quote->id'>
<button type="submit" class="btn btn-primary shadow-lg " id="savelike"><i class="fas fa-heart"></button></i>
</form>
</li>
@endif
@endauth
php laravel laravel-5
add a comment |
The else section of my code is not being displayed in my laravel blade. I need to get the else section of the statement to show. currently, that button is missing when the if statement is false.
@auth
@if(optional($quote->userLike))
@foreach($quote->userLike as $like)
@if($like->pivot->user_id == $id) //passing user id from controller here
<li class="list-inline-item">
<form method="POST" action="route('likequote')" class="likequote">
@csrf
<input type="hidden" class="form-control col-md-4" name="likequote" id="likequote" value='$quote->id'>
<button type="submit" class="btn btn-danger shadow-lg " id="savelike"><i class="fas fa-heart"></button></i>
</form>
</li>
@endif
@endforeach
@else
<li class="list-inline-item">
<form method="POST" action="route('likequote')" class="likequote">
@csrf
<input type="hidden" class="form-control col-md-4" name="likequote" id="likequote" value='$quote->id'>
<button type="submit" class="btn btn-primary shadow-lg " id="savelike"><i class="fas fa-heart"></button></i>
</form>
</li>
@endif
@endauth
php laravel laravel-5
The else section of my code is not being displayed in my laravel blade. I need to get the else section of the statement to show. currently, that button is missing when the if statement is false.
@auth
@if(optional($quote->userLike))
@foreach($quote->userLike as $like)
@if($like->pivot->user_id == $id) //passing user id from controller here
<li class="list-inline-item">
<form method="POST" action="route('likequote')" class="likequote">
@csrf
<input type="hidden" class="form-control col-md-4" name="likequote" id="likequote" value='$quote->id'>
<button type="submit" class="btn btn-danger shadow-lg " id="savelike"><i class="fas fa-heart"></button></i>
</form>
</li>
@endif
@endforeach
@else
<li class="list-inline-item">
<form method="POST" action="route('likequote')" class="likequote">
@csrf
<input type="hidden" class="form-control col-md-4" name="likequote" id="likequote" value='$quote->id'>
<button type="submit" class="btn btn-primary shadow-lg " id="savelike"><i class="fas fa-heart"></button></i>
</form>
</li>
@endif
@endauth
php laravel laravel-5
php laravel laravel-5
edited Mar 28 at 6:03
Akash Kumar Verma
1,2842 gold badges5 silver badges17 bronze badges
1,2842 gold badges5 silver badges17 bronze badges
asked Mar 28 at 4:22
Davinchi1Davinchi1
105 bronze badges
105 bronze badges
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
- first method
@auth
@forelse($quote->userLike as $like)
@if($like->pivot->user_id == $id) //passing user id from controller here
<li class="list-inline-item">
<form method="POST" action="route('likequote')" class="likequote">
@csrf
<input type="hidden" class="form-control col-md-4" name="likequote" id="likequote" value='$quote->id'>
<button type="submit" class="btn btn-danger shadow-lg " id="savelike"><i class="fas fa-heart"></button></i>
</form>
</li>
@endif
@empty
<li class="list-inline-item">
<form method="POST" action="route('likequote')" class="likequote">
@csrf
<input type="hidden" class="form-control col-md-4" name="likequote" id="likequote" value='$quote->id'>
<button type="submit" class="btn btn-primary shadow-lg " id="savelike"><i class="fas fa-heart"></button></i>
</form>
</li>
@endforelse
@endauth
- Second
@auth
@if(!empty($quote->userLike) && count($quote->userLike)>0)
@foreach($quote->userLike as $like)
@if($like->pivot->user_id == $id) //passing user id from controller here
<li class="list-inline-item">
<form method="POST" action="route('likequote')" class="likequote">
@csrf
<input type="hidden" class="form-control col-md-4" name="likequote" id="likequote" value='$quote->id'>
<button type="submit" class="btn btn-danger shadow-lg " id="savelike"><i class="fas fa-heart"></button></i>
</form>
</li>
@endif
@endforeach
@else
<li class="list-inline-item">
<form method="POST" action="route('likequote')" class="likequote">
@csrf
<input type="hidden" class="form-control col-md-4" name="likequote" id="likequote" value='$quote->id'>
<button type="submit" class="btn btn-primary shadow-lg " id="savelike"><i class="fas fa-heart"></button></i>
</form>
</li>
@endif
@endauth
Thanks @Akash The first example works if I remove the@endforeach
in the middle. The second does not work. Button does not show.
– Davinchi1
Mar 28 at 12:48
that's my mistake i updated answer. please mark this as accepted answer
– Akash Kumar Verma
Mar 28 at 12:58
also updated second solution
– Akash Kumar Verma
Mar 28 at 13:19
add a comment |
You can try this
@auth
@isset($quote)
@if($quote->userLike->count() > 0)
@foreach($quote->userLike as $like)
@if($like->pivot->user_id == $id) //passing user id from controller here
<li class="list-inline-item">
<form method="POST" action="route('likequote')" class="likequote">
@csrf
<input type="hidden" class="form-control col-md-4" name="likequote" id="likequote" value='$quote->id'>
<button type="submit" class="btn btn-danger shadow-lg " id="savelike"><i class="fas fa-heart"></button></i>
</form>
</li>
@endif
@endforeach
@else
<li class="list-inline-item">
<form method="POST" action="route('likequote')" class="likequote">
@csrf
<input type="hidden" class="form-control col-md-4" name="likequote" id="likequote" value='$quote->id'>
<button type="submit" class="btn btn-primary shadow-lg " id="savelike"><i class="fas fa-heart"></button></i>
</form>
</li>
@endif
@endisset
@endauth
Thanks @manisha. This works, even without the@isset
– Davinchi1
Mar 28 at 12:51
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55390132%2fif-statement-not-presenting-the-else-result%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
- first method
@auth
@forelse($quote->userLike as $like)
@if($like->pivot->user_id == $id) //passing user id from controller here
<li class="list-inline-item">
<form method="POST" action="route('likequote')" class="likequote">
@csrf
<input type="hidden" class="form-control col-md-4" name="likequote" id="likequote" value='$quote->id'>
<button type="submit" class="btn btn-danger shadow-lg " id="savelike"><i class="fas fa-heart"></button></i>
</form>
</li>
@endif
@empty
<li class="list-inline-item">
<form method="POST" action="route('likequote')" class="likequote">
@csrf
<input type="hidden" class="form-control col-md-4" name="likequote" id="likequote" value='$quote->id'>
<button type="submit" class="btn btn-primary shadow-lg " id="savelike"><i class="fas fa-heart"></button></i>
</form>
</li>
@endforelse
@endauth
- Second
@auth
@if(!empty($quote->userLike) && count($quote->userLike)>0)
@foreach($quote->userLike as $like)
@if($like->pivot->user_id == $id) //passing user id from controller here
<li class="list-inline-item">
<form method="POST" action="route('likequote')" class="likequote">
@csrf
<input type="hidden" class="form-control col-md-4" name="likequote" id="likequote" value='$quote->id'>
<button type="submit" class="btn btn-danger shadow-lg " id="savelike"><i class="fas fa-heart"></button></i>
</form>
</li>
@endif
@endforeach
@else
<li class="list-inline-item">
<form method="POST" action="route('likequote')" class="likequote">
@csrf
<input type="hidden" class="form-control col-md-4" name="likequote" id="likequote" value='$quote->id'>
<button type="submit" class="btn btn-primary shadow-lg " id="savelike"><i class="fas fa-heart"></button></i>
</form>
</li>
@endif
@endauth
Thanks @Akash The first example works if I remove the@endforeach
in the middle. The second does not work. Button does not show.
– Davinchi1
Mar 28 at 12:48
that's my mistake i updated answer. please mark this as accepted answer
– Akash Kumar Verma
Mar 28 at 12:58
also updated second solution
– Akash Kumar Verma
Mar 28 at 13:19
add a comment |
- first method
@auth
@forelse($quote->userLike as $like)
@if($like->pivot->user_id == $id) //passing user id from controller here
<li class="list-inline-item">
<form method="POST" action="route('likequote')" class="likequote">
@csrf
<input type="hidden" class="form-control col-md-4" name="likequote" id="likequote" value='$quote->id'>
<button type="submit" class="btn btn-danger shadow-lg " id="savelike"><i class="fas fa-heart"></button></i>
</form>
</li>
@endif
@empty
<li class="list-inline-item">
<form method="POST" action="route('likequote')" class="likequote">
@csrf
<input type="hidden" class="form-control col-md-4" name="likequote" id="likequote" value='$quote->id'>
<button type="submit" class="btn btn-primary shadow-lg " id="savelike"><i class="fas fa-heart"></button></i>
</form>
</li>
@endforelse
@endauth
- Second
@auth
@if(!empty($quote->userLike) && count($quote->userLike)>0)
@foreach($quote->userLike as $like)
@if($like->pivot->user_id == $id) //passing user id from controller here
<li class="list-inline-item">
<form method="POST" action="route('likequote')" class="likequote">
@csrf
<input type="hidden" class="form-control col-md-4" name="likequote" id="likequote" value='$quote->id'>
<button type="submit" class="btn btn-danger shadow-lg " id="savelike"><i class="fas fa-heart"></button></i>
</form>
</li>
@endif
@endforeach
@else
<li class="list-inline-item">
<form method="POST" action="route('likequote')" class="likequote">
@csrf
<input type="hidden" class="form-control col-md-4" name="likequote" id="likequote" value='$quote->id'>
<button type="submit" class="btn btn-primary shadow-lg " id="savelike"><i class="fas fa-heart"></button></i>
</form>
</li>
@endif
@endauth
Thanks @Akash The first example works if I remove the@endforeach
in the middle. The second does not work. Button does not show.
– Davinchi1
Mar 28 at 12:48
that's my mistake i updated answer. please mark this as accepted answer
– Akash Kumar Verma
Mar 28 at 12:58
also updated second solution
– Akash Kumar Verma
Mar 28 at 13:19
add a comment |
- first method
@auth
@forelse($quote->userLike as $like)
@if($like->pivot->user_id == $id) //passing user id from controller here
<li class="list-inline-item">
<form method="POST" action="route('likequote')" class="likequote">
@csrf
<input type="hidden" class="form-control col-md-4" name="likequote" id="likequote" value='$quote->id'>
<button type="submit" class="btn btn-danger shadow-lg " id="savelike"><i class="fas fa-heart"></button></i>
</form>
</li>
@endif
@empty
<li class="list-inline-item">
<form method="POST" action="route('likequote')" class="likequote">
@csrf
<input type="hidden" class="form-control col-md-4" name="likequote" id="likequote" value='$quote->id'>
<button type="submit" class="btn btn-primary shadow-lg " id="savelike"><i class="fas fa-heart"></button></i>
</form>
</li>
@endforelse
@endauth
- Second
@auth
@if(!empty($quote->userLike) && count($quote->userLike)>0)
@foreach($quote->userLike as $like)
@if($like->pivot->user_id == $id) //passing user id from controller here
<li class="list-inline-item">
<form method="POST" action="route('likequote')" class="likequote">
@csrf
<input type="hidden" class="form-control col-md-4" name="likequote" id="likequote" value='$quote->id'>
<button type="submit" class="btn btn-danger shadow-lg " id="savelike"><i class="fas fa-heart"></button></i>
</form>
</li>
@endif
@endforeach
@else
<li class="list-inline-item">
<form method="POST" action="route('likequote')" class="likequote">
@csrf
<input type="hidden" class="form-control col-md-4" name="likequote" id="likequote" value='$quote->id'>
<button type="submit" class="btn btn-primary shadow-lg " id="savelike"><i class="fas fa-heart"></button></i>
</form>
</li>
@endif
@endauth
- first method
@auth
@forelse($quote->userLike as $like)
@if($like->pivot->user_id == $id) //passing user id from controller here
<li class="list-inline-item">
<form method="POST" action="route('likequote')" class="likequote">
@csrf
<input type="hidden" class="form-control col-md-4" name="likequote" id="likequote" value='$quote->id'>
<button type="submit" class="btn btn-danger shadow-lg " id="savelike"><i class="fas fa-heart"></button></i>
</form>
</li>
@endif
@empty
<li class="list-inline-item">
<form method="POST" action="route('likequote')" class="likequote">
@csrf
<input type="hidden" class="form-control col-md-4" name="likequote" id="likequote" value='$quote->id'>
<button type="submit" class="btn btn-primary shadow-lg " id="savelike"><i class="fas fa-heart"></button></i>
</form>
</li>
@endforelse
@endauth
- Second
@auth
@if(!empty($quote->userLike) && count($quote->userLike)>0)
@foreach($quote->userLike as $like)
@if($like->pivot->user_id == $id) //passing user id from controller here
<li class="list-inline-item">
<form method="POST" action="route('likequote')" class="likequote">
@csrf
<input type="hidden" class="form-control col-md-4" name="likequote" id="likequote" value='$quote->id'>
<button type="submit" class="btn btn-danger shadow-lg " id="savelike"><i class="fas fa-heart"></button></i>
</form>
</li>
@endif
@endforeach
@else
<li class="list-inline-item">
<form method="POST" action="route('likequote')" class="likequote">
@csrf
<input type="hidden" class="form-control col-md-4" name="likequote" id="likequote" value='$quote->id'>
<button type="submit" class="btn btn-primary shadow-lg " id="savelike"><i class="fas fa-heart"></button></i>
</form>
</li>
@endif
@endauth
edited Mar 28 at 13:19
answered Mar 28 at 4:27
Akash Kumar VermaAkash Kumar Verma
1,2842 gold badges5 silver badges17 bronze badges
1,2842 gold badges5 silver badges17 bronze badges
Thanks @Akash The first example works if I remove the@endforeach
in the middle. The second does not work. Button does not show.
– Davinchi1
Mar 28 at 12:48
that's my mistake i updated answer. please mark this as accepted answer
– Akash Kumar Verma
Mar 28 at 12:58
also updated second solution
– Akash Kumar Verma
Mar 28 at 13:19
add a comment |
Thanks @Akash The first example works if I remove the@endforeach
in the middle. The second does not work. Button does not show.
– Davinchi1
Mar 28 at 12:48
that's my mistake i updated answer. please mark this as accepted answer
– Akash Kumar Verma
Mar 28 at 12:58
also updated second solution
– Akash Kumar Verma
Mar 28 at 13:19
Thanks @Akash The first example works if I remove the
@endforeach
in the middle. The second does not work. Button does not show.– Davinchi1
Mar 28 at 12:48
Thanks @Akash The first example works if I remove the
@endforeach
in the middle. The second does not work. Button does not show.– Davinchi1
Mar 28 at 12:48
that's my mistake i updated answer. please mark this as accepted answer
– Akash Kumar Verma
Mar 28 at 12:58
that's my mistake i updated answer. please mark this as accepted answer
– Akash Kumar Verma
Mar 28 at 12:58
also updated second solution
– Akash Kumar Verma
Mar 28 at 13:19
also updated second solution
– Akash Kumar Verma
Mar 28 at 13:19
add a comment |
You can try this
@auth
@isset($quote)
@if($quote->userLike->count() > 0)
@foreach($quote->userLike as $like)
@if($like->pivot->user_id == $id) //passing user id from controller here
<li class="list-inline-item">
<form method="POST" action="route('likequote')" class="likequote">
@csrf
<input type="hidden" class="form-control col-md-4" name="likequote" id="likequote" value='$quote->id'>
<button type="submit" class="btn btn-danger shadow-lg " id="savelike"><i class="fas fa-heart"></button></i>
</form>
</li>
@endif
@endforeach
@else
<li class="list-inline-item">
<form method="POST" action="route('likequote')" class="likequote">
@csrf
<input type="hidden" class="form-control col-md-4" name="likequote" id="likequote" value='$quote->id'>
<button type="submit" class="btn btn-primary shadow-lg " id="savelike"><i class="fas fa-heart"></button></i>
</form>
</li>
@endif
@endisset
@endauth
Thanks @manisha. This works, even without the@isset
– Davinchi1
Mar 28 at 12:51
add a comment |
You can try this
@auth
@isset($quote)
@if($quote->userLike->count() > 0)
@foreach($quote->userLike as $like)
@if($like->pivot->user_id == $id) //passing user id from controller here
<li class="list-inline-item">
<form method="POST" action="route('likequote')" class="likequote">
@csrf
<input type="hidden" class="form-control col-md-4" name="likequote" id="likequote" value='$quote->id'>
<button type="submit" class="btn btn-danger shadow-lg " id="savelike"><i class="fas fa-heart"></button></i>
</form>
</li>
@endif
@endforeach
@else
<li class="list-inline-item">
<form method="POST" action="route('likequote')" class="likequote">
@csrf
<input type="hidden" class="form-control col-md-4" name="likequote" id="likequote" value='$quote->id'>
<button type="submit" class="btn btn-primary shadow-lg " id="savelike"><i class="fas fa-heart"></button></i>
</form>
</li>
@endif
@endisset
@endauth
Thanks @manisha. This works, even without the@isset
– Davinchi1
Mar 28 at 12:51
add a comment |
You can try this
@auth
@isset($quote)
@if($quote->userLike->count() > 0)
@foreach($quote->userLike as $like)
@if($like->pivot->user_id == $id) //passing user id from controller here
<li class="list-inline-item">
<form method="POST" action="route('likequote')" class="likequote">
@csrf
<input type="hidden" class="form-control col-md-4" name="likequote" id="likequote" value='$quote->id'>
<button type="submit" class="btn btn-danger shadow-lg " id="savelike"><i class="fas fa-heart"></button></i>
</form>
</li>
@endif
@endforeach
@else
<li class="list-inline-item">
<form method="POST" action="route('likequote')" class="likequote">
@csrf
<input type="hidden" class="form-control col-md-4" name="likequote" id="likequote" value='$quote->id'>
<button type="submit" class="btn btn-primary shadow-lg " id="savelike"><i class="fas fa-heart"></button></i>
</form>
</li>
@endif
@endisset
@endauth
You can try this
@auth
@isset($quote)
@if($quote->userLike->count() > 0)
@foreach($quote->userLike as $like)
@if($like->pivot->user_id == $id) //passing user id from controller here
<li class="list-inline-item">
<form method="POST" action="route('likequote')" class="likequote">
@csrf
<input type="hidden" class="form-control col-md-4" name="likequote" id="likequote" value='$quote->id'>
<button type="submit" class="btn btn-danger shadow-lg " id="savelike"><i class="fas fa-heart"></button></i>
</form>
</li>
@endif
@endforeach
@else
<li class="list-inline-item">
<form method="POST" action="route('likequote')" class="likequote">
@csrf
<input type="hidden" class="form-control col-md-4" name="likequote" id="likequote" value='$quote->id'>
<button type="submit" class="btn btn-primary shadow-lg " id="savelike"><i class="fas fa-heart"></button></i>
</form>
</li>
@endif
@endisset
@endauth
answered Mar 28 at 12:27
ManishaManisha
748 bronze badges
748 bronze badges
Thanks @manisha. This works, even without the@isset
– Davinchi1
Mar 28 at 12:51
add a comment |
Thanks @manisha. This works, even without the@isset
– Davinchi1
Mar 28 at 12:51
Thanks @manisha. This works, even without the
@isset
– Davinchi1
Mar 28 at 12:51
Thanks @manisha. This works, even without the
@isset
– Davinchi1
Mar 28 at 12:51
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55390132%2fif-statement-not-presenting-the-else-result%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown