小编Ton*_*moy的帖子

如何在用户注册时插入多个表并编辑注册

在注册新用户时,如何在多个表(默认用户表和父表)中插入行?我知道我需要编辑模型,AuthController和视图.

我的用户模型:

namespace Jcfk\Models\User;

class User extends Model implements AuthenticatableContract,
    CanResetPasswordContract
{
    use Authenticatable, CanResetPassword;

    /**
     * The database table used by the model.
     *
     * @var string
     */
    protected $table = 'user';

    /**
     * @var string
     */
    protected $primaryKey = 'user_id';

    /**
     * @var bool
     */
    public $timestamps = false;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = ['email', 'password'];

    /**
     * The attributes excluded from the model's JSON form.
     * …
Run Code Online (Sandbox Code Playgroud)

html php laravel-5.1

16
推荐指数
1
解决办法
1353
查看次数

标签 统计

html ×1

laravel-5.1 ×1

php ×1