Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Programming Q&A
More laravel help
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Genaga" data-source="post: 364980" data-attributes="member: 57551"><p>Is there an error that should up? Are you in a blade there?</p><p></p><p>[code]@ if (count(DB::table('setting')->where('hiring', '=', 1)->get()) > 0)[/code]</p><p>Probably another way to do it but I'm drawing a blank right now.</p><p></p><p>First errors was forgetting the '=', this is used to determine how you want to search, you can use various operators here. (< > != etc)</p><p>Then you forgot to use ->get() which actually retrieves the collection.</p><p>Then you wasn't actually checking anything, there is more than one way to do this, but i simply counted the records, if no records showed up (count would be 0) then not hiring.</p><p></p><p>Hope this is of some help and I'm actually correct, give us a shout if there's anything else!</p></blockquote><p></p>
[QUOTE="Genaga, post: 364980, member: 57551"] Is there an error that should up? Are you in a blade there? [code]@ if (count(DB::table('setting')->where('hiring', '=', 1)->get()) > 0)[/code] Probably another way to do it but I'm drawing a blank right now. First errors was forgetting the '=', this is used to determine how you want to search, you can use various operators here. (< > != etc) Then you forgot to use ->get() which actually retrieves the collection. Then you wasn't actually checking anything, there is more than one way to do this, but i simply counted the records, if no records showed up (count would be 0) then not hiring. Hope this is of some help and I'm actually correct, give us a shout if there's anything else! [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
More laravel help
Top