Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR)
Call to a member function translations() on null Symfony\Component\Debug\Exception\FatalThrowableError thrown with message "Call to a member function translations() on null" Stacktrace: #0 Symfony\Component\Debug\Exception\FatalThrowableError in /home/nchreg6/app/Http/Controllers/front/NewsController.php:24
Application frames (1) All frames (1)
0
Symfony
\
Component
\
Debug
\
Exception
\
FatalThrowableError
/
app
/
Http
/
Controllers
/
front
/
NewsController.php
24
/
home
/
nchreg6
/
app
/
Http
/
Controllers
/
front
/
NewsController.php
use App\Models\News;
use App\Models\Covid;
use Illuminate\Http\Request;
use App;
use App\Http\Controllers\Controller;
use App\Models\PagesBannersTranslation;
 
class NewsController extends Controller
{
    public function details(Request $request)
    {
        $id = $request->id;
        $locale = App::getLocale();
 
        $details = News::where('news_id', $id)->first();
        $next = News::where('news_id', '>=', $id + 1)->orderBy('news_id', 'asc')->first();
        $previous = News::where('news_id', '<=', $id - 1)->orderBy('news_id', 'desc')->first();
        $images = App\Models\NewsImages::where('news_id', $id)->get();
 
        $translations = $details->translations($locale, $id);
 
        $setting = App\Models\SettingTranslation::where(['locale' => $locale, 'setting_id' => 1])->first();;
 
        return view('Front/News.index', compact('setting', 'details', 'next', 'previous', 'translations', 'images'));
    }
 
    public function covid_details(Request $request)
    {
        $id = $request->id;
        $locale = App::getLocale();
 
        $details = Covid::where('covid_id', $id)->first();
        $next = Covid::where('covid_id', '>=', $id + 1)->orderBy('covid_id', 'asc')->first();
        $previous = Covid::where('covid_id', '<=', $id - 1)->orderBy('covid_id', 'desc')->first();
        $images = App\Models\CovidImages::where('covid_id', $id)->get();
 
        $translations = $details->translations($locale, $id);
 
//        dd($translations);
        $setting = App\Models\SettingTranslation::where(['locale' => $locale, 'setting_id' => 1])->first();;
Arguments
  1. "Call to a member function translations() on null"
    

Environment & details:

empty
empty
empty
empty
empty
Key Value
CONTEXT_DOCUMENT_ROOT
"/home/nchreg6/public_html"
CONTEXT_PREFIX
""
DOCUMENT_ROOT
"/home/nchreg6/public_html"
GATEWAY_INTERFACE
"CGI/1.1"
H2PUSH
"off"
H2_PUSH
"off"
H2_PUSHED
""
H2_PUSHED_ON
""
H2_STREAM_ID
"3"
H2_STREAM_TAG
"487422-13-3"
HTTP2
"on"
HTTPS
"on"
HTTP_ACCEPT
"*/*"
HTTP_HOST
"nchr.eg"
HTTP_USER_AGENT
"claudebot"
HTTP_X_HTTPS
"1"
PATH
"/bin:/usr/bin"
QUERY_STRING
""
REDIRECT_H2PUSH
"off"
REDIRECT_H2_PUSH
"off"
REDIRECT_H2_PUSHED
""
REDIRECT_H2_PUSHED_ON
""
REDIRECT_H2_STREAM_ID
"3"
REDIRECT_H2_STREAM_TAG
"487422-13-3"
REDIRECT_HTTP2
"on"
REDIRECT_HTTPS
"on"
REDIRECT_SCRIPT_URI
"https://nchr.eg/ar/news-details/1044"
REDIRECT_SCRIPT_URL
"/ar/news-details/1044"
REDIRECT_SSL_TLS_SNI
"nchr.eg"
REDIRECT_STATUS
"200"
REDIRECT_UNIQUE_ID
"ZgVkeQPJwxP1nlsrJuBcdQAASwQ"
REDIRECT_URL
"/ar/news-details/1044"
REMOTE_ADDR
"3.238.62.124"
REMOTE_PORT
"37442"
REQUEST_METHOD
"GET"
REQUEST_SCHEME
"https"
REQUEST_URI
"/ar/news-details/1044"
SCRIPT_FILENAME
"/home/nchreg6/public_html/index.php"
SCRIPT_NAME
"/index.php"
SCRIPT_URI
"https://nchr.eg/ar/news-details/1044"
SCRIPT_URL
"/ar/news-details/1044"
SERVER_ADDR
"198.46.82.21"
SERVER_ADMIN
"webmaster@nchr.eg"
SERVER_NAME
"nchr.eg"
SERVER_PORT
"443"
SERVER_PROTOCOL
"HTTP/2.0"
SERVER_SIGNATURE
""
SERVER_SOFTWARE
"Apache"
SSL_TLS_SNI
"nchr.eg"
TZ
"America/New_York"
UNIQUE_ID
"ZgVkeQPJwxP1nlsrJuBcdQAASwQ"
PHP_SELF
"/index.php"
REQUEST_TIME_FLOAT
1711629434.2201
REQUEST_TIME
1711629434
argv
[]
argc
0
APP_NAME
"Laravel"
APP_ENV
"production"
APP_KEY
"base64:ruE2O/pEg9durEY8ziSnzxxegUgyJuLNHaRVJeRhZrQ="
APP_DEBUG
"true"
APP_URL
"http://localhost"
LOG_CHANNEL
"stack"
DB_CONNECTION
"mysql"
DB_HOST
"localhost"
DB_PORT
"3306"
DB_DATABASE
"nchreg6_stage"
DB_USERNAME
"nchreg6_stage_user"
DB_PASSWORD
"wOD0o3mi0fdl"
BROADCAST_DRIVER
"log"
CACHE_DRIVER
"file"
QUEUE_CONNECTION
"sync"
SESSION_DRIVER
"file"
SESSION_LIFETIME
"120"
REDIS_HOST
"127.0.0.1"
REDIS_PASSWORD
"null"
REDIS_PORT
"6379"
MAIL_DRIVER
"smtp"
MAIL_HOST
"smtp.mailtrap.io"
MAIL_PORT
"2525"
MAIL_USERNAME
"null"
MAIL_PASSWORD
"null"
MAIL_ENCRYPTION
"null"
AWS_ACCESS_KEY_ID
""
AWS_SECRET_ACCESS_KEY
""
AWS_DEFAULT_REGION
"us-east-1"
AWS_BUCKET
""
PUSHER_APP_ID
""
PUSHER_APP_KEY
""
PUSHER_APP_SECRET
""
PUSHER_APP_CLUSTER
"mt1"
MIX_PUSHER_APP_KEY
""
MIX_PUSHER_APP_CLUSTER
"mt1"
Key Value
APP_NAME
"Laravel"
APP_ENV
"production"
APP_KEY
"base64:ruE2O/pEg9durEY8ziSnzxxegUgyJuLNHaRVJeRhZrQ="
APP_DEBUG
"true"
APP_URL
"http://localhost"
LOG_CHANNEL
"stack"
DB_CONNECTION
"mysql"
DB_HOST
"localhost"
DB_PORT
"3306"
DB_DATABASE
"nchreg6_stage"
DB_USERNAME
"nchreg6_stage_user"
DB_PASSWORD
"wOD0o3mi0fdl"
BROADCAST_DRIVER
"log"
CACHE_DRIVER
"file"
QUEUE_CONNECTION
"sync"
SESSION_DRIVER
"file"
SESSION_LIFETIME
"120"
REDIS_HOST
"127.0.0.1"
REDIS_PASSWORD
"null"
REDIS_PORT
"6379"
MAIL_DRIVER
"smtp"
MAIL_HOST
"smtp.mailtrap.io"
MAIL_PORT
"2525"
MAIL_USERNAME
"null"
MAIL_PASSWORD
"null"
MAIL_ENCRYPTION
"null"
AWS_ACCESS_KEY_ID
""
AWS_SECRET_ACCESS_KEY
""
AWS_DEFAULT_REGION
"us-east-1"
AWS_BUCKET
""
PUSHER_APP_ID
""
PUSHER_APP_KEY
""
PUSHER_APP_SECRET
""
PUSHER_APP_CLUSTER
"mt1"
MIX_PUSHER_APP_KEY
""
MIX_PUSHER_APP_CLUSTER
"mt1"
0. Whoops\Handler\PrettyPageHandler