File tree 3 files changed +3
-13
lines changed
3 files changed +3
-13
lines changed Original file line number Diff line number Diff line change 10
10
11
11
class NameCast implements CastsAttributes
12
12
{
13
- protected ?string $ firstName ;
14
-
15
- protected ?string $ lastName ;
16
-
17
- public function __construct (?string $ firstName = null , ?string $ lastName = null )
13
+ public function __construct (protected ?string $ firstName = null , protected ?string $ lastName = null )
18
14
{
19
15
$ this ->firstName = $ firstName ?: 'first_name ' ;
20
16
$ this ->lastName = $ lastName ?: 'last_name ' ;
Original file line number Diff line number Diff line change 28
28
*/
29
29
class Name implements JsonSerializable, Jsonable, Castable
30
30
{
31
- protected ?string $ firstName ;
32
-
33
- protected ?string $ lastName ;
34
-
35
31
public static function from (?string $ name ): self
36
32
{
37
33
$ parts = explode (' ' , trim ($ name ), 2 );
@@ -43,10 +39,8 @@ public static function from(?string $name): self
43
39
return new static (Arr::get ($ parts , 0 ), $ lastName );
44
40
}
45
41
46
- public function __construct (?string $ firstName , ?string $ lastName = null )
42
+ public function __construct (protected ?string $ firstName , protected ?string $ lastName = null )
47
43
{
48
- $ this ->firstName = $ firstName ;
49
- $ this ->lastName = $ lastName ;
50
44
}
51
45
52
46
public function first (): ?string
Original file line number Diff line number Diff line change 7
7
use Illuminate \Support \Str as BaseStr ;
8
8
9
9
/** @internal */
10
- class Str extends BaseStr
10
+ final class Str extends BaseStr
11
11
{
12
12
public static function firstLetter (string $ value ): string
13
13
{
You can’t perform that action at this time.
0 commit comments