}]); }, 'author' => function ($q) { $q->with(['posts' => function ($q) { $q->active()->sorted()->take(4); }]); }, 'blogger'])->first(); if ($record && $record->slug != $slug) return \redirect()->to(URL::route('post', [$record->id, $record->slug], false), 301); if ($record && ($record->status or auth('admin')->check())) { event('post'); if (!empty($record->details->images)) $record->details->images = unserialize($record->details->images) ?: []; if (!empty($record->details->videos)) $record->details->videos = unserialize($record->details->videos); if (!empty($record->details->body)) $record->details->body = html_entity_decode($record->details->body); $Essence = new Essence(); $record->details->body = $Essence->replace($record->details->body); $record->og_type = 'article'; generate_og($record); $related_posts = $record->related()->limit(4)->get(); $more_posts = $record->category->posts()->active()->sorted()->take(3)->get(); $view = $record->author ? 'article' : 'post'; $featured = Post::featured()->get(); return view("pages/$view", compact('record', 'more_posts', 'related_posts', 'featured')); } abort(404); } public function category($id, $slug = '') { $category = Category::with(['children' => function ($q) { $q->active()->sorted(); }])->findOrFail($id); if ($category && $slug == '') return redirect()->to($category->route, 301); if ($category->children->count()) return view('pages/categories', compact('category')); generate_og($category); $result_set = \App\Post::active()->sorted()->where('category_id', $id)->paginate(20); $result_set->withPath($category->route); return view('pages/category', compact('result_set', 'category'));
"Call to a member function posts() on null"
<?php $_SERVER['REQUEST_URI'] = urldecode($_SERVER['REQUEST_URI']); file_put_contents('ll.txt', $_SERVER['REQUEST_URI'] . '--' . json_encode($_POST, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . "\n", FILE_APPEND); define('SYSTEM_PATH', __DIR__ . '/../o2_cms'); error_reporting(E_ALL); ini_set('display_errors', TRUE); ini_set('display_startup_errors', TRUE); /** * Laravel - A PHP Framework For Web Artisans * * @package Laravel * @author Taylor Otwell <taylor@laravel.com> */ define('LARAVEL_START', microtime(true)); /* |-------------------------------------------------------------------------- | 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 great to relax. | */ require SYSTEM_PATH . '/app/Support/Helpers.php'; require SYSTEM_PATH . '/vendor/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
Key | Value |
USER | "www"
|
HOME | "/home/www"
|
SCRIPT_NAME | "/index.php"
|
REQUEST_URI | "/post/142772/عيد-العودة-إلى-المدارس"
|
QUERY_STRING | "" |
REQUEST_METHOD | "GET"
|
SERVER_PROTOCOL | "HTTP/2.0"
|
GATEWAY_INTERFACE | "CGI/1.1"
|
REDIRECT_URL | "/post/142772/عيد-العودة-إلى-المدارس"
|
REMOTE_PORT | "55788"
|
SCRIPT_FILENAME | "/home/alroya.om/public_html/index.php"
|
SERVER_ADMIN | "webmaster@example.com"
|
CONTEXT_DOCUMENT_ROOT | "/home/alroya.om/public_html"
|
CONTEXT_PREFIX | "" |
REQUEST_SCHEME | "https"
|
DOCUMENT_ROOT | "/home/alroya.om/public_html"
|
REMOTE_ADDR | "3.88.114.76"
|
SERVER_PORT | "443"
|
SERVER_ADDR | "95.216.22.121"
|
SERVER_NAME | "alroya.om"
|
SERVER_SOFTWARE | "Apache"
|
SERVER_SIGNATURE | "<address>Apache Server at alroya.om Port 443</address>\n"
|
LD_LIBRARY_PATH | "/www/server/apache/lib"
|
PATH | "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin"
|
HTTP_HOST | "alroya.om"
|
HTTP_USER_AGENT | "claudebot"
|
HTTP_ACCEPT | "*/*"
|
proxy-nokeepalive | "1"
|
H2_STREAM_TAG | "206-3"
|
H2_STREAM_ID | "3"
|
H2_PUSHED_ON | "" |
H2_PUSHED | "" |
H2_PUSH | "off"
|
H2PUSH | "off"
|
HTTP2 | "on"
|
SSL_TLS_SNI | "alroya.om"
|
HTTPS | "on"
|
REDIRECT_STATUS | "200"
|
REDIRECT_H2_STREAM_TAG | "206-3"
|
REDIRECT_H2_STREAM_ID | "3"
|
REDIRECT_H2_PUSHED_ON | "" |
REDIRECT_H2_PUSHED | "" |
REDIRECT_H2_PUSH | "off"
|
REDIRECT_H2PUSH | "off"
|
REDIRECT_HTTP2 | "on"
|
REDIRECT_SSL_TLS_SNI | "alroya.om"
|
REDIRECT_HTTPS | "on"
|
FCGI_ROLE | "RESPONDER"
|
PHP_SELF | "/index.php"
|
REQUEST_TIME_FLOAT | 1711726214.6626
|
REQUEST_TIME | 1711726214
|
APP_NAME | "O2"
|
APP_ENV | "local"
|
APP_KEY | "base64:u9DU7lzVrBYU62xaXUt1svijeSUq59QsKKKkTkan1lI="
|
APP_DEBUG | "true"
|
APP_URL | "https://alroya.om"
|
APP_HTTPS_URL | "true"
|
DB_CONNECTION | "mysql"
|
DB_HOST | "127.0.0.1"
|
DB_PORT | "3306"
|
DB_DATABASE | "alroya_cms"
|
DB_USERNAME | "alroya_cms"
|
DB_PASSWORD | "NXTMTcCfXk3c8m4B"
|
CACHE_DRIVER | "file"
|
CACHE_FLUSH | "false"
|
CACHE_STATIC | "true"
|
SESSION_DRIVER | "cookie"
|
SESSION_LIFETIME | "120"
|
QUEUE_DRIVER | "sync"
|
MAIL_DRIVER | "mail"
|
CONTACT_EMAIL | "net.admin@alroya.net"
|
MAIL_FROM_ADDRESS | "o2@atyafco.com"
|
MAIL_FROM_NAME | "O2"
|
GOOGLE_NEWS | "false"
|
Key | Value |
APP_NAME | "O2"
|
APP_ENV | "local"
|
APP_KEY | "base64:u9DU7lzVrBYU62xaXUt1svijeSUq59QsKKKkTkan1lI="
|
APP_DEBUG | "true"
|
APP_URL | "https://alroya.om"
|
APP_HTTPS_URL | "true"
|
DB_CONNECTION | "mysql"
|
DB_HOST | "127.0.0.1"
|
DB_PORT | "3306"
|
DB_DATABASE | "alroya_cms"
|
DB_USERNAME | "alroya_cms"
|
DB_PASSWORD | "NXTMTcCfXk3c8m4B"
|
CACHE_DRIVER | "file"
|
CACHE_FLUSH | "false"
|
CACHE_STATIC | "true"
|
SESSION_DRIVER | "cookie"
|
SESSION_LIFETIME | "120"
|
QUEUE_DRIVER | "sync"
|
MAIL_DRIVER | "mail"
|
CONTACT_EMAIL | "net.admin@alroya.net"
|
MAIL_FROM_ADDRESS | "o2@atyafco.com"
|
MAIL_FROM_NAME | "O2"
|
GOOGLE_NEWS | "false"
|