0
Enterprise hasMany
Setorempresa
Setorempresa belongsTo
Enterprise
Setorempresa hasMany
Functionary
Functionary belongsTo
Setorempresa
With this data in hand, how do I count how many id_status = 1 employees are allocated in sectors of type = "Administrative"? I tried it the way down, but it didn’t work and I guess I’m away the right way.
{{ $empresa->SetorEmpresa->where('tipo', 'Administrativo')->Funcionario->where('id_status', 1)->count() }}
I am using Laravel 5.1 and this data will be loaded into a view from the Company object.
You need to be clearer, your question has become very confusing. Try to give more details, so we can help you
– Wallace Maxters
thanks, but I managed to solve @Wallacemaxters
– Raylan Soares