with this
<?php
namespace App\Http\Controllers;
use App\Pays;
use Illuminate\Http\Request;
use App\Societe;
use App\Http\Requests;
use App\Http\Controllers\Controller;
class SocieteController extends Controller
{
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
//
$data['societes'] = Societe::with('payss')->get();
//$societes=Societe::all();
$data['page_title'] = 'Sociétés';
return view('societes.index',compact('societes'))->with($data);
}
FatalErrorException in Model.php line 732: Class 'Pays' not found
you do realise you seem to have a type in your Pays Model?
,,, public function Payss() ,,,
notice payss
hi,
I found ! it's not about payss, it's because, you need to use return $this->belongsTo('App\Pays'); and not $this->belongsTo('Pays');
:)
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community