Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[10.x] Fix confusing namespace in Castables samples #9135

Merged
merged 1 commit into from
Nov 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions eloquent-mutators.md
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ When attaching a custom cast to a model, cast parameters may be specified by sep

You may want to allow your application's value objects to define their own custom cast classes. Instead of attaching the custom cast class to your model, you may alternatively attach a value object class that implements the `Illuminate\Contracts\Database\Eloquent\Castable` interface:

use App\Models\Address;
use App\ValueObjects\Address;

protected $casts = [
'address' => Address::class,
Expand All @@ -731,7 +731,7 @@ Objects that implement the `Castable` interface must define a `castUsing` method

<?php

namespace App\Models;
namespace App\ValueObjects;

use Illuminate\Contracts\Database\Eloquent\Castable;
use App\Casts\Address as AddressCast;
Expand All @@ -751,7 +751,7 @@ Objects that implement the `Castable` interface must define a `castUsing` method

When using `Castable` classes, you may still provide arguments in the `$casts` definition. The arguments will be passed to the `castUsing` method:

use App\Models\Address;
use App\ValueObjects\Address;

protected $casts = [
'address' => Address::class.':argument',
Expand Down