Answers for "insert data into three tables using single form in laravel 7"

PHP
0

insrt data in two tablesuse laravelonce

class Something extends Eloquent {

    protected $table = 'something';

    public function users()
    {
        return $this->hasMany('User', 'id_something');
    }
}

class User extends Eloquent implements UserInterface, RemindableInterface {

    use UserTrait, RemindableTrait;

    protected $table = 'something_users';

    protected $hidden = array('password', 'remember_token');

    public function something()
    {
        return $this->belongsTo('Something', 'id_something');
    }
}
Posted by: Guest on August-14-2020
0

insert data into three tables using single form in laravel 7

students table 
------------------------------------  
id(PK, A_I)  |  student_name | nationality

teachers table
------------------------------------
id(PK, A_I)  |  teacher_name |  email

classroom table
----------------------
id(PK, A_I)   | date   | teacher_id(FK to teachers.id)  |  student_id(FK to students.id)
Posted by: Guest on October-10-2020

Code answers related to "insert data into three tables using single form in laravel 7"

Browse Popular Code Answers by Language