mardi 28 septembre 2021

Trying to get property 'domain' of non-object Laravel

// Get the link details $link = Link::active()->where('slug', $slug)->with(['user', 'pixels', 'scripts', 'cta', 'domain'])->first();

    // If the domain does not belong to the system
    if ($domain != config('settings.link_shorten_domain') ) {

       
        // Make sure the link domain match what is in the db
        if (  $link->domain['name'] != $domain )
            return redirect()->away( config('app.url') ); 

    }


     // Redirect to homepage if the link doesn't exist
    if ( ! $link )
        return redirect()->away( config('app.url') );


    // Check the feature usage ability
    // Only check for non admin users


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire