Support for countables to the pluralizer
use Illuminate\Support\Str;
use App\Models\User;
$users = User::take(1)->get();
return Str::plural('user', $users->count()); //user
$users = User::take(2)->get();
return Str::plural('user', $users->count()); //users
I hope you enjoy the code.
Top comments (0)