Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

how to filter laravel eloquent

// Suppose tha my model is Tool;

Tool::all()->filter(
  	// Here you can filter the Tool model
	fn (Tool $tool) => in_array($tag, $tool->getAttribute("tags"))
);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #filter #laravel #eloquent
ADD COMMENT
Topic
Name
5+5 =