我是laravel的新手。我有2张桌子
class Client extends Model
{
protected $fillable = ['name'];
public function clientmoreinfo()
{
return $this->hasMany('App\Moreinfoclient');
}
}
class Moreinfoclient extends Model
{
protected $table = 'clients_additionalfield';
protected $fillable = ['client_id', 'nameinput', 'valueinput'];
public function clients()
{
return $this->belongsTo('App\Client');
}
}
这是我添加任意数量条目的方式,更重要的是,我如何在以后更新或删除它们?
提前谢谢大家!