1 | <?php |
||
31 | class Activity extends Model |
||
32 | { |
||
33 | use RelationTrait; |
||
34 | |||
35 | /** |
||
36 | * Timestamp enabled. |
||
37 | * |
||
38 | * @var bool |
||
39 | */ |
||
40 | public $timestamps = true; |
||
41 | |||
42 | /** |
||
43 | * Name of database table. |
||
44 | * |
||
45 | * @var string |
||
46 | */ |
||
47 | protected $table = 'users_activity'; |
||
48 | |||
49 | /** |
||
50 | * List of allowed columns to be used in $this->fill(). |
||
51 | * |
||
52 | * @var array |
||
53 | */ |
||
54 | protected $fillable = ['type_id', 'parent_id', 'user_id', 'item_id', 'action_id', 'data']; |
||
55 | |||
56 | /** |
||
57 | * List of columns and their cast data-type. |
||
58 | * |
||
59 | * @var array |
||
60 | */ |
||
61 | protected $casts = [ |
||
62 | 'data' => 'array', |
||
63 | ]; |
||
64 | |||
65 | /** |
||
66 | * Get a value from the data field using "dot" notation. |
||
67 | * |
||
68 | * @param string $name |
||
69 | * |
||
70 | * @return Collection |
||
71 | */ |
||
72 | public function dataCollection($name) |
||
76 | |||
77 | /** |
||
78 | * Get a value from the data field using "dot" notation. |
||
79 | * |
||
80 | * @param string $name |
||
81 | * |
||
82 | * @return mixed |
||
83 | */ |
||
84 | public function dataValue($name) |
||
88 | } |
||
89 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: