Need to get a query where there is at least one condition

I have a table like this: Table: item isBeautiful: Boolean isGreat: Boolean isAvaliable: Boolean I want to make a query with Eloquent that gives me all the items that are avaliable and are either isBeautiful or isGreat, or both. $avaliableitems = ite

How to display the 'Favorites / Loved' list in Laravel 5.3?

I have implemented a like/favourite function in my application, where a user can favourite a Charity - this is then stored in a table in my database - which is working reasonably well. How would I go about outputting the users favourites list to them

O WH and O WH or O WH Laravel Query?

I am trying to do a "WHERE AND WHERE OR WHERE" query with laravel, basically what I want to do is get all the events where the user_id equals a certain something AND where type = 'something1' OR 'something2' but right now the event is now only s

disable add a new line in the session table in laravel

I have laravel 5.0 . and set sessions drivers to database . I have some link that no require to insert new row in sessions table . how i can disable inserting new row only for www.site.com/download .Create a new route/middleware type for sessionless

Laravel Memory problem?

dear all i am facing such problem on DO server, i have tried everything , the whole site is working 100% properly on linux server using Homestead but after uploading it , it works for one time , going down many times after reloading or refreshing the

using POST instead of PUT in laravel

I'm using Laravel to build and api based admin control application and I'm using Route:resource instead of regular GET and POST methods. Just realized my hosting provider DOESN'T ALLOW PUT and DELETE now I need to so now I have to use POST and GET me

hasManyThrough does not work

I have this table, categories: id | name | slug Products: id | name | slug | category_id | brand_id Brands: id | name | slug | The problem occurs when I try to bring Brands here in the category of feature. Category Model public function brands() { re

The user's editing resource does not work

I have a user resource with is linked in the users table. My Route: Route::resource('user', 'UserController'); UserController.php public function edit($id) { $user = User::find($id); return view('user.edit')->with(array('user'=>$user)); } public fun

Maximum nesting level of the Use laravel feature

so I started to use Laravel auth and in my Route in web middleware I wrote : Route::group(['middleware' => ['web']], function () { Route::auth(); }); and I got this error : Maximum function nesting level of '100' reached, aborting! and I tried to use

Laravel 5 entry :: get an error

Why am I having this error? I tried to add use Illuminate\Http\Request; but same error? Also is $username = $request->input('username'); the same as $username = Input::get('username');? The error I get is: FatalErrorException in LoginController.php l

Is there a utility to get a subset of Laravel Collection?

Is there any method like only for collections? $col=collection(['foo'=>'x','bar'=>'z',-]); $subcol=$col->only(['foo','bar']); // returns ['foo'=>'x','bar'=>'z'] I know that I can use the following function to achieve that, but I hope there

basic controller not found laravel php

<?php namespace vendor\laravel\framework\src\Illuminate\Support\Facades; use DB; use BaseController; class ModuleController extends BaseController{ public function index() { //Display data from students table. $data=DB::connection('mysql')->select('

Using the if condition to display data in Blade

How print value in this code: <li class="price-val">{{ $value->price ? '$value->price € month<span class="price-fea-ct">*VAT Included</span>':'$value->price € month' }}</li> $value->price variable is

Laravel 4.2 Environments

I've set 2 environments for my app, a local development on my machine and the production environment on the server. I set them in bootstrap/start.phplike this: $env = $app->detectEnvironment(array( 'ariel_dev' => array('Ariels-MacBook-Pro.local'), '

Laravel - Get a user who has specific relationships

I have a user with countries relationship. (hasMany) user_id 1 country_id 1 user_id 1 country_id 2 ... What I want is to get those users who have both countries (country 1 and country 2) How can I do this? I'm reading http://laravel.com/docs/eloquent

How to configure Laravel to work properly on localhost?

So I have this website, that some else build on Laravel. Since I need to make some changes I want to copy this website locally and make it work locally, so that later on I can apply the changes. I really don't want to work on the live site. So I copi