myerscode/utilities-strings
A small PHP utility library providing string helper functions for common formatting and manipulation tasks. Useful for Laravel or plain PHP projects to reduce boilerplate for trimming, case conversion, searching, and other everyday string operations.
String::create("text")->upper()->reverse()), which aligns well with Laravel’s emphasis on expressive, chainable syntax. This could improve readability in string-heavy business logic (e.g., validation messages, dynamic UI text, or data transformations).Str::* helpers, this package could fill gaps for:
Str helper may suffice, making this package a "nice-to-have" rather than a critical dependency.String::create()).new \Myerscode\String("text")), which may feel less idiomatic than Laravel’s DI container.Str helper or Blade templates).Str for critical paths (e.g., bulk string processing).e()).Str and Illuminate\Support\Stringable to avoid redundancy.Str::of(), Stringable) that achieve similar goals with less friction?Str::upper() calls)?Str already handles better?HtmlString or MarkdownString classes?UserProfileService).{{ String::create($name)->title()->limit(20) }}).String::create($error)->snakeCase()).Str for one-off transformations (e.g., Str::slug()).StringService for user-facing text).// app/Helpers/StringHelper.php
use Myerscode\String as MyersString;
class StringHelper {
public static function create(string $value): MyersString {
return MyersString::create($value);
}
}
Str for key operations.snake_case() functions) with the package’s methods.{{ String::create($input)->htmlEntities() }}).Stringable objects, it may integrate seamlessly with Laravel’s Str::of().Str::upper() vs. package’s upper() for non-English text).spatie/array-to-xml or nesbot/carbon).composer why-not to verify compatibility.composer.json as a dev dependency (initially) to test without locking into production.AppServiceProvider.Str helper.String::create()).Str may need to adapt to the fluent syntax.String::create()->trim()->slug() for URLs").X-String-Package tag to error logs for easier triage.// Benchmark example
$strings = collect(range(1, 1000))->map(fn($i) => "string_$i");
$start = microtime(true);
$strings->each(fn($s) => String::create($s)->reverse()->upper());
$time = microtime(true) - $start;
Str methods.DB::raw("SELECT String::create(name)->upper() FROM users")), ensure the package supports raw SQL contexts or use Laravel’s query builders instead.How can I help you explore Laravel packages today?