cullymason
4 years ago

Model::lists() with a where clause

Posted 4 years ago by cullymason

Is there a straight forward way to add a constraint when I use the lists() on a Model?

For example

// So return a list of the ids of the projects that are active
Project::lists('id','project_name')->where('project_active','=','1');

Please sign in or create an account to participate in this conversation.