PHP Build a REST API with Laravel Seeding the Database Seeding the Database Review

Peter Vann
Peter Vann
26,472 Points

Can't find answer to quiz question, anywhere!?!

Even looking at the Laravel docs, can't find an answer to this quiz question:

How do we access an attribute called name that is part of the model Author?

Author::first()__________

1 Answer

Peter Vann
Peter Vann
26,472 Points

BTW, it's from "Build a REST API with Laravel"

Actually, I finally figured it out...

The correct approach/answer is Author::first()->name;

I tried that initially and somehow got an error (typo I didn't notice, I suspect), and that threw me off!?!