I have a HasMany relationship that works on the whole site. Just made a new controller and in this controller I have this inside a method:
// find all galleries that need to be deleted...
$galleries = DB::table('galleries')->where('curdeldate', '<', time())->get();
foreach($galleries as $gallery)
{
//get all the images associated with the gallery
$photos = $gallery->photos;
this throws this message: ErrorException Undefined property: stdClass::$photos but I cannot figure out why...
I also included this:
use App\Gallery;
use App\Photo;
dd($galleries)