I am very new to the laravel, I am writing a normal if condition I want to convert that if condition to ternary operator ,please help me to convert it
$posts=DB::table('posts')->where('name',$id)->exists();
if($posts == false)
return $user->hasRole() ||$user->hasRights();