title: LogicException in Model.php line 2709: Relationship method must return an object of type Illuminate\Database\Eloquent\Relations\Relation
body: <p>I'm supposed to display author details in bookformat method. But facing LogicException. Any suggestions thanks in advance. Im getting error like this  LogicException in Model.php line 2709: Relationship method must return an object of type Illuminate\Database\Eloquent\Relations\Relation. Any help that would be great for me. If I comment authors in bookFormat() everything works fine. But Idk why I'm unable to get author details in my bookformat().</p>
  
  <pre><code>#booksController.php
      namespace App\Http\Controllers;
      use Illuminate\Http\Request;
      use Illuminate\Support\Facades\Input;
      use App\Models\Book;
      use App\Models\Author;
  
      class BooksController extends Controller
      {
          public function index()
          {
              $books = Book::all();
              $results = [];
              foreach ($books as $book) {
               $results [] = $this-&gt;bookFormat($book);
           } 
           return $results; 
       }
          public function bookFormat($book){  
              return [ 
                  'Id' =&gt; $book-&gt;id,
                  'Title' =&gt; $book-&gt;title,
                  'Author' =&gt; [ 
                      'Id' =&gt; $book-&gt;author-&gt;id,
                      'First_name' =&gt; $book-&gt;author-&gt;first_name,
                      'Last_name' =&gt; $book-&gt;author-&gt;last_name
                  ],
                  'Price' =&gt; $book-&gt;price,
                  'ISBN' =&gt; $book-&gt;isbn,
                  'Language' =&gt; $book-&gt;language,
                  'Year' =&gt; $book-&gt;year_of_publisher
              ];
          }
      }
  
      //book.php
      namespace App\Models;
      use Illuminate\Database\Eloquent\Model;
  
      class Book extends Model
      {
          public $timestamps = TRUE;
          protected $table = 'books';
      //rules
          public static $rules = [
              'title' =&gt; 'required|max:255',
              'isbn' =&gt; 'required|max:50',
              'author_id' =&gt; 'required|max:255',
              'language' =&gt; 'required|max:255',
              'price' =&gt; 'required|max:255',
              'year_of_publisher' =&gt; 'required'
          ];
      //relationship
          public function author() {
              $this-&gt;belongsTo(Author::class);
          }
      }
  </code></pre>