Hello,
i try to explain my Problem.
I have 2 Tables in relationship
shootingbooks and shootingranges
in table shootingranges.totalplaces you can found a Number ex.20 That means, the total amount of Places in the shootingrang
in my table shootingbook i have stored, all entry from users.
With end = Null i can select all occupied entrys. on field place i can found the actuall place in use.
I tried to make a method
$totalplaces = Shootingrange::where('id' ,7)->first()->totalplaces; $occupiedplaces = Shootingbook::select('bahn')->where('shootingrange_id', 7)->whereNULL('ende')->get(); $op = $occupiedplaces->toArray();
first i get the max number of totalplaces second i get the occupiedplaces
with range i can get all Numbers from 1 to X
dd(range(1,$totalplaces ));
BUT, how can i become all free places?
Is there a eloquent method??
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community