Laravel Queries: Adding custom feature like Soft Deletes
问题 All of my tables have a column called isTest . What I want is to be able to set a switch so that my code will either include all records in my queries or [more importantly] exclude all records where isTest is true. I imagine the code will work similarly to Soft Deletes and include sql code similar to: AND (isTest != TRUE) to SQL generated by Eloquent and the Query Builder. I am not really familiar with Eloquent events, but I have found this question which might be the right place to start,