Laravel 8 isNotEmpty {#collection-method}
isNotEmpty
方法用于判断指定字符串是否不为空:
use Illuminate\Support\Str;
$result = Str::of(' ')->trim()->isNotEmpty();
// false
$result = Str::of('Laravel')->trim()->isNotEmpty();
// true
isNotEmpty
方法用于判断指定字符串是否不为空:
use Illuminate\Support\Str;
$result = Str::of(' ')->trim()->isNotEmpty();
// false
$result = Str::of('Laravel')->trim()->isNotEmpty();
// true