Maison >développement back-end >tutoriel php >laravel的YourCustomPivot怎么玩?
<code>public function newPivot(Model $parent, array $attributes, $table, $exists) { return new YourCustomPivot($parent, $attributes, $table, $exists); } class Base extends Eloquent { public function newPivot(Eloquent $parent, array $attributes, $table, $exists) { return new Membership($parent, $attributes, $table, $exists); } </code>
资料说这样玩,但是还是晕,各种报错
<code>public function newPivot(Model $parent, array $attributes, $table, $exists) { return new YourCustomPivot($parent, $attributes, $table, $exists); } class Base extends Eloquent { public function newPivot(Eloquent $parent, array $attributes, $table, $exists) { return new Membership($parent, $attributes, $table, $exists); } </code>
资料说这样玩,但是还是晕,各种报错