Skip to content

Commit b8a2d8f

Browse files
Fix namespace in Castables samples (#9135)
Co-authored-by: Anton Mykhailovskyi <amykhailovskyi@brightgrove.com>
1 parent 2a64317 commit b8a2d8f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

eloquent-mutators.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ When attaching a custom cast to a model, cast parameters may be specified by sep
721721

722722
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:
723723

724-
use App\Models\Address;
724+
use App\ValueObjects\Address;
725725

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

732732
<?php
733733

734-
namespace App\Models;
734+
namespace App\ValueObjects;
735735

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

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

754-
use App\Models\Address;
754+
use App\ValueObjects\Address;
755755

756756
protected $casts = [
757757
'address' => Address::class.':argument',

0 commit comments

Comments
 (0)