I need to select users with specific age from model User, but have this error:
DateTime::__construct(): Failed to parse time string (birth) at position 0 (b): The timezone could not be found in the database
part of controller:
$users = User::where(Carbon::parse('birth')->diff(Carbon::now())->format('%y'), '>=', 18)->get();
when i use it in view all working fine:
@foreach ($userss as $user)
<?php $age_year = Carbon::parse($user->birth)->diff(Carbon::now())->format('%y'); ?>
@endforeach
Thanks for answers!