$the_article = Article::find($article);
if ($the_article) {
} else {
if (Article::where('language.en_US.url', $article)->count() == 1) {
$the_article = Article::where('language.en_US.url', $article)->first();
}
}
if ($the_article) {
} else {
$urlComponents = parse_url(url()->current());
$count = Segment::where('type', 'page')->where('url_components.path', $urlComponents['path'])->count();
$the_issue = PublicationIssue::where('key', $issue)->first();
$the_article = $the_issue->articles()->where('language.en_US.url', $article)->first();
}
if ($the_article) {
if(isset($the_article->views)) {
$views = $the_article->views;
if(isset($the_issue)) {
$views[$the_issue->id] = $count;
}
$the_article->views = $views;
} else {
$the_article->views = [$the_issue->_id => $count];
$the_article->save();
}
$the_article->save();
$webpage = WebPage::where('routename', \Route::getCurrentRoute()->getName())->first();
return view('v1.home', ['template' => $webpage->template(), 'webpage' => $webpage, 'article' => $the_article]);
"Call to a member function articles() on null"
<?php
/**
* Laravel - A PHP Framework For Web Artisans
*
* @package Laravel
* @author Taylor Otwell <taylorotwell@gmail.com>
*/
/*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader for
| our application. We just need to utilize it! We'll simply require it
| into the script here so that we don't have to worry about manual
| loading any of our classes later on. It feels nice to relax.
|
*/
require __DIR__.'/../bootstrap/autoload.php';
/*
|--------------------------------------------------------------------------
| Turn On The Lights
|--------------------------------------------------------------------------
|
| We need to illuminate PHP development, so let us turn on the lights.
| This bootstraps the framework and gets it ready for use, then it
| will load up this application so that we can run it and send
| the responses back to the browser and delight our users.
|
*/
$app = require_once __DIR__.'/../bootstrap/app.php';
/*
|--------------------------------------------------------------------------
| Run The Application
Key | Value |
REDIRECT_STATUS | "200"
|
HTTP_X_FORWARDED_FOR | "3.237.91.98, 15.158.50.245"
|
HTTP_X_FORWARDED_PROTO | "http"
|
HTTP_X_FORWARDED_PORT | "80"
|
HTTP_HOST | "qlifemedia.com"
|
HTTP_X_AMZN_TRACE_ID | "Root=1-6605ae2f-4643a01a6d41fc195676f747"
|
HTTP_USER_AGENT | "claudebot"
|
HTTP_X_AMZ_CF_ID | "HMHYZfKE1pYh08nLxVDjWOanlggfyB8OQOCJkowtdCxx87zrj4IfJw=="
|
HTTP_VIA | "2.0 a7a07e0b0db92670f70b5d65da05ed76.cloudfront.net (CloudFront)"
|
HTTP_ACCEPT | "*/*"
|
HTTP_CLOUDFRONT_IS_MOBILE_VIEWER | "false"
|
HTTP_CLOUDFRONT_IS_TABLET_VIEWER | "false"
|
HTTP_CLOUDFRONT_IS_SMARTTV_VIEWER | "false"
|
HTTP_CLOUDFRONT_IS_DESKTOP_VIEWER | "true"
|
HTTP_CLOUDFRONT_VIEWER_COUNTRY | "US"
|
HTTP_CLOUDFRONT_FORWARDED_PROTO | "https"
|
HTTP_CLOUDFRONT_VIEWER_ASN | "14618"
|
PATH | "/sbin:/usr/sbin:/bin:/usr/bin"
|
SERVER_SIGNATURE | "" |
SERVER_SOFTWARE | "Apache/2.4.58 (Amazon) PHP/7.2.34"
|
SERVER_NAME | "qlifemedia.com"
|
SERVER_ADDR | "10.0.7.87"
|
SERVER_PORT | "80"
|
REMOTE_ADDR | "10.0.1.194"
|
DOCUMENT_ROOT | "/var/www/phplaravel/public"
|
REQUEST_SCHEME | "http"
|
CONTEXT_PREFIX | "" |
CONTEXT_DOCUMENT_ROOT | "/var/www/phplaravel/public"
|
SERVER_ADMIN | "root@localhost"
|
SCRIPT_FILENAME | "/var/www/phplaravel/public/index.php"
|
REMOTE_PORT | "15154"
|
REDIRECT_URL | "/lasvegas/qlife-las-vegas-december-2018/www.reinamoramusic.com"
|
GATEWAY_INTERFACE | "CGI/1.1"
|
SERVER_PROTOCOL | "HTTP/1.1"
|
REQUEST_METHOD | "GET"
|
QUERY_STRING | "" |
REQUEST_URI | "/lasvegas/qlife-las-vegas-december-2018/www.reinamoramusic.com"
|
SCRIPT_NAME | "/index.php"
|
PHP_SELF | "/index.php"
|
REQUEST_TIME_FLOAT | 1711648303.689
|
REQUEST_TIME | 1711648303
|
APP_ENV | "production"
|
APP_KEY | "base64:SoorvHVXlCOoujzxe+mdkoh8igTi+4DWuXYXnvLdZrY="
|
APP_DEBUG | "true"
|
APP_LOG_LEVEL | "false"
|
NSS_STRICT_NOFORK | "DISABLED"
|
MONGODB_DATABASE_HOST | "10.0.9.19"
|
LOCAL_CONFIG | "qlife"
|
CACHE_DRIVER | "memcached"
|
SESSION_DRIVER | "memcached"
|
QUEUE_DRIVER | "sqs"
|
Key | Value |
APP_ENV | "production"
|
APP_KEY | "base64:SoorvHVXlCOoujzxe+mdkoh8igTi+4DWuXYXnvLdZrY="
|
APP_DEBUG | "true"
|
APP_LOG_LEVEL | "false"
|
NSS_STRICT_NOFORK | "DISABLED"
|
MONGODB_DATABASE_HOST | "10.0.9.19"
|
LOCAL_CONFIG | "qlife"
|
CACHE_DRIVER | "memcached"
|
SESSION_DRIVER | "memcached"
|
QUEUE_DRIVER | "sqs"
|