- Copy both files to the appropriate namespace.
- Register the Rector rule:
->withRules([ RenameEnumCasesToPascalCaseRector::class,
])
<?php | |
namespace App\Models; | |
// ... | |
use App\Enums\UserMediaCollection; | |
class User extends Authenticatable | |
{ | |
// ... |
<?php | |
use App\Enums\PostStatus; | |
use Illuminate\Database\Eloquent\Model; | |
use Illuminate\Database\Eloquent\Attributes\Attribute; | |
class Post extends Model | |
{ | |
// We can easily cast the 'status' column to an enum instance |
<?php | |
use App\Models\Team; | |
use App\Models\User; | |
use Database\Seeders\RoleAndPermissionSeeder; | |
use Database\Seeders\TeamSeeder; | |
use Database\Seeders\UserSeeder; | |
use function Pest\Laravel\actingAs; | |
use function Pest\Laravel\get; |
If you encounter caching issues with your @teleport Livewire/Blade directive after running php artisan view:cache, you may notice problems appearing instead of the expected compilation.
To resolve this issue, manually add compilation to the Blade directive.
class AppServiceProvider extends ServiceProvider
<?php | |
protected static function generateUniqueSlug(string $title): string | |
{ | |
$slug = str_slug($title); | |
if (static::query()->where('slug', $slug)->doesntExist()) { | |
return $slug; | |
} |
<?php | |
namespace App\Models; | |
use Illuminate\Database\Eloquent\Factories\HasFactory; | |
use Illuminate\Database\Eloquent\Model; | |
use Illuminate\Support\Facades\DB; | |
class Blog extends Model | |
{ |
<?php | |
// PHP 8.3 introduces exciting new functions for | |
// incrementing and decrementing alphanumeric strings! | |
// Let's dive into some examples to see how they work. | |
// str_increment — Increment an alphanumeric string | |
echo str_increment("a") . PHP_EOL; // b |