skip to Main Content

Laravel. how to get the removedEmployees from mergedEmployees?

this code is not working: $removedEmployees = $mergedEmployees->diff($uniqueEmployees); here is my code. $employees1 = Employee::where('employment_status', '<>', 'SEPARATED') ->where('client_code_1', $client->client_code) ->where('position', $grouping->position) ->where('billable_rate', $grouping->billable_rate) ->get(); $employees2 = Employee::where('employment_status', '<>', 'SEPARATED') ->where('client_code_2', $client->client_code) ->where('position', $grouping->position) ->where('billable_rate', $grouping->billable_rate) ->get(); $mergedEmployees = $employees1->merge($employees2); $uniqueEmployees…

VIEW QUESTION

Laravel – How to filter rows in query properly?

I want to filter records with relation which has another relation with conditions and with count > 0 Code: $classClass = ClassClass::query() ->with('parent') ->with('children', function (BelongsTo $query) { $query ->withCount(['serialNumbers' => function($query) { $query ->whereNull('serial_number_parent_id') ->whereNull('inherit_class_for_serial_number_id'); }]); }) ->where('parent_class_id','=', $class->id)…

VIEW QUESTION

Installing Laravel 10 in a Subfolder

I am attempting to install my Laravel 10 project in a subfolder so that I can access it at example.com/laravel-project/ instead of example.com/laravel-project/public/. Here is the .htaccess configuration I tried in the /laravel-project/ directory: <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^(.*)$…

VIEW QUESTION
Back To Top
Search