In Laravel 5.2 I made a folder app/Models. This is one of my models: app/Models/Pin.php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Pin extends Model {
protected $table = 'pins';
}
In my composer.json I added to "classmap": app/Models. Then I runned composer dump-autoload
In my PinController, I have:
use App\Models\Pin as Pin;
When I do: Pin::all(); it returns a collection.
But when I try: Pin::find(1); I get:
Method find not found in class \App\Models\Pin
Is their a way I can get all methods from Eloquent?
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1Vm4FaW
via IFTTT
Aucun commentaire:
Enregistrer un commentaire