SELECT * FROM `books` WHERE books.type = 'rare' AND books.band - $value < $result$books= DB::table('books')
->where('type ','=', 'rare')
->whereRaw('band - $value < $result') // Syntax error
$user = DB::table('users')
->join('hobbies', 'users.id', '=', 'hobbies.user_id')
->join('personal_informations', 'users.id', '=', 'personal_informations.user_id')
->join('educations', 'users.id', '=', 'educations.user_id')
->select(
'users.id',
'users.firstname',
'lastname',
'status',
'email',
'birthday',
'gender',
'profile_photo',
'header_photo',
'status_chat',
'hobbies.*', 'personal_informations.*', 'educations.*')
->where('users.id', $this->user_id)
->first();