How to override a Laravel model's default table name?

We have to pass protected $table = 'YOUR TABLE NAME'; in your respective Model

You can also read: Mysql Interview Questions



namespace App;

use Illuminate\Database\Eloquent\Model;

class Login extends Model
    protected $table = 'admin';
    static function logout() {  
        if(session()->flush() || session()->regenerate()) {
            return true;

Suggest An Answer

No suggestions avaliable!

Related Interview Questions