File: /var/www/vhosts/uat-api.tsprojects.net/admin.plotterbox.tsprojects.net/app/Models/Author.php
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class Author extends Model
{
use HasFactory, SoftDeletes;
protected $table = 'tblAuthor';
protected $fillable = ['firstName', 'secondName', 'authorInfo' , 'type', 'userId', 'address', 'email', 'phone', 'active'];
/**
* The table relationships name change from snake_case to camelCase.
*
* @var string
*/
public static $snakeAttributes = false;
/**
* The books that belong to the author.
*/
public function books()
{
return $this->belongsToMany(Books::class, 'tblBooksAuthor', 'authorId', 'bookId');
}
}