dimanche 4 septembre 2016

empty array in instance variable

im learning about laravel and im following some videos from laracasts, but im having a issue in displaying the data from the controller, i made all right, but still appears me empty array, the instance Card isnt working, here is my code:

Model: Card.php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Card extends Model
{
    //
}

route:

Route::get('cards/{card}', 'CardsController@show');

CardsController:

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use App\Card;
use App\Http\Requests;
use App\Http\Controllers\Controller;



class CardsController extends Controller
{

    public function show(Card $card)
    {
        return $card;
        //$card = Card::find($card);
        //return view('cards.show', compact('card'));
    }
}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire