Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR)
Call to a member function tours() on null Symfony\Component\Debug\Exception\FatalThrowableError thrown with message "Call to a member function tours() on null" Stacktrace: #0 Symfony\Component\Debug\Exception\FatalThrowableError in /home/nepalascentreks/ascent/laravel/app/Http/Controllers/GetPublicPageController.php:83
Application frames (1) All frames (1)
0
Symfony
\
Component
\
Debug
\
Exception
\
FatalThrowableError
/
app
/
Http
/
Controllers
/
GetPublicPageController.php
83
/
home
/
nepalascentreks
/
ascent
/
laravel
/
app
/
Http
/
Controllers
/
GetPublicPageController.php
    public function step1()
    {
        return view('public.tour.step1');
    }
 
    public function page()
    {
        return view('public.pages.page');
    }
 
    public function aboutPage($category,$slug)
    {
        $page = Page::where('slug','=', $slug)->first();
        return view('public.pages.page')
        ->withPage($page);
    }
    public function getByCountry($country)
    {
        $country = Country::where('name','=',$country)->first();
        $tours = $country->tours()->with('category')->get(['category_id']);
        $categories = $tours->pluck('category')->unique();
 
        return view('public.pages.country')
        ->withCategories($categories)
        ->withCountry($country);
    }
 
    public function getByCategory($category)
    {
        $stuff = TourCategory::where('slug','=', $category)->first();
        $query = Tour::whereHas('category', function($r) use($category) {
            $r->where('tcategories.slug','=', $category);
        })->get();
        return view('public.pages.style')
        ->withResults($query)
        ->withCategory($stuff);
    }
 
    public function getBycountryCategory($country,$category)
    {
Arguments
  1. "Call to a member function tours() on null"
    

Environment & details:

empty
empty
empty
empty
empty
Key Value
CONTEXT_DOCUMENT_ROOT
"/home/nepalascentreks/public_html"
CONTEXT_PREFIX
""
DOCUMENT_ROOT
"/home/nepalascentreks/public_html"
GATEWAY_INTERFACE
"CGI/1.1"
HTTPS
"on"
HTTP_ACCEPT
"*/*"
HTTP_HOST
"www.nepalascenttreks.com"
HTTP_USER_AGENT
"claudebot"
HTTP_X_HTTPS
"1"
PATH
"/bin:/usr/bin"
PHP_INI_SCAN_DIR
"/opt/cpanel/ea-php71/root/etc:/opt/cpanel/ea-php71/root/etc/php.d:."
QUERY_STRING
""
REDIRECT_HTTPS
"on"
REDIRECT_SCRIPT_URI
"https://www.nepalascenttreks.com/trips/adventure"
REDIRECT_SCRIPT_URL
"/trips/adventure"
REDIRECT_SSL_TLS_SNI
"www.nepalascenttreks.com"
REDIRECT_STATUS
"200"
REDIRECT_UNIQUE_ID
"Zga82MM2cp59yakz0tnlpQAAAAU"
REDIRECT_URL
"/trips/adventure"
REMOTE_ADDR
"3.238.162.113"
REMOTE_PORT
"55856"
REQUEST_METHOD
"GET"
REQUEST_SCHEME
"https"
REQUEST_URI
"/trips/adventure"
SCRIPT_FILENAME
"/home/nepalascentreks/public_html/index.php"
SCRIPT_NAME
"/index.php"
SCRIPT_URI
"https://www.nepalascenttreks.com/trips/adventure"
SCRIPT_URL
"/trips/adventure"
SERVER_ADDR
"50.62.57.200"
SERVER_ADMIN
"webmaster@nepalascenttreks.com"
SERVER_NAME
"www.nepalascenttreks.com"
SERVER_PORT
"443"
SERVER_PROTOCOL
"HTTP/1.1"
SERVER_SIGNATURE
"<address>Apache Server at www.nepalascenttreks.com Port 443</address>\n"
SERVER_SOFTWARE
"Apache"
SSL_TLS_SNI
"www.nepalascenttreks.com"
TZ
"Asia/Kathmandu"
UNIQUE_ID
"Zga82MM2cp59yakz0tnlpQAAAAU"
PHP_SELF
"/index.php"
REQUEST_TIME_FLOAT
1711717592.9554
REQUEST_TIME
1711717592
argv
[]
argc
0
APP_NAME
"NepalAscentTreks"
APP_ENV
"production"
APP_KEY
"base64:gbaOLB+B4NnAEzh7hoo4mhBXhpmWtFmSLVpjocPZBFk="
APP_DEBUG
"true"
APP_LOG_LEVEL
"debug"
APP_URL
"https://www.nepalascenttreks.com"
DB_CONNECTION
"mysql"
DB_HOST
"127.0.0.1"
DB_PORT
"3306"
DB_DATABASE
"nepalascentreks_main"
DB_USERNAME
"nepalascentreks_gain"
DB_PASSWORD
"Dp!b-jcOM5gq"
BROADCAST_DRIVER
"log"
CACHE_DRIVER
"file"
SESSION_DRIVER
"file"
QUEUE_DRIVER
"sync"
REDIS_HOST
"127.0.0.1"
REDIS_PASSWORD
"null"
REDIS_PORT
"6379"
MAIL_DRIVER
"smtp"
MAIL_HOST
"nepalascenttreks.com"
MAIL_PORT
"465"
MAIL_USERNAME
"noreply@nepalascenttreks.com"
MAIL_PASSWORD
"^&1Tm.ri49b1"
MAIL_ENCRYPTION
"ssl"
PUSHER_APP_ID
""
PUSHER_APP_KEY
""
PUSHER_APP_SECRET
""
MAILCHIMP_APIKEY
"485fc34934c22b80bc67a1f89eccfb79-us17"
MAILCHIMP_LIST_ID
"b90a3c3f62"
ANALYTICS_VIEW_ID
"163506316"
Key Value
APP_NAME
"NepalAscentTreks"
APP_ENV
"production"
APP_KEY
"base64:gbaOLB+B4NnAEzh7hoo4mhBXhpmWtFmSLVpjocPZBFk="
APP_DEBUG
"true"
APP_LOG_LEVEL
"debug"
APP_URL
"https://www.nepalascenttreks.com"
DB_CONNECTION
"mysql"
DB_HOST
"127.0.0.1"
DB_PORT
"3306"
DB_DATABASE
"nepalascentreks_main"
DB_USERNAME
"nepalascentreks_gain"
DB_PASSWORD
"Dp!b-jcOM5gq"
BROADCAST_DRIVER
"log"
CACHE_DRIVER
"file"
SESSION_DRIVER
"file"
QUEUE_DRIVER
"sync"
REDIS_HOST
"127.0.0.1"
REDIS_PASSWORD
"null"
REDIS_PORT
"6379"
MAIL_DRIVER
"smtp"
MAIL_HOST
"nepalascenttreks.com"
MAIL_PORT
"465"
MAIL_USERNAME
"noreply@nepalascenttreks.com"
MAIL_PASSWORD
"^&1Tm.ri49b1"
MAIL_ENCRYPTION
"ssl"
PUSHER_APP_ID
""
PUSHER_APP_KEY
""
PUSHER_APP_SECRET
""
MAILCHIMP_APIKEY
"485fc34934c22b80bc67a1f89eccfb79-us17"
MAILCHIMP_LIST_ID
"b90a3c3f62"
ANALYTICS_VIEW_ID
"163506316"
0. Whoops\Handler\PrettyPageHandler