Select file
"; return $imageUpload; }); ////////////////////////////////////////////////////// ////////////////////////////////////////////////////// ////////////////////////////////////////////////////// // contact Form Route::post('/contactAjax', function() { $data = array(); $data['name'] = params('name'); $data['email'] = params('email'); $data['message'] = params('message'); if (params('contact-literate') == 'false') { $response = array( 'success'=>false, 'message'=>"Please Check the 'I am not a robot field'. Javascript is required" ); return Response::json($response); } if(filter_var($data['email'], FILTER_VALIDATE_EMAIL)) { // $success = TRUE; // $email_valid = TRUE; $to = 'two@twomag.com'; // $to = 'all@zaybiz.com'; $subject = 'Contact Form from TWOmag.com'; $message = " Name : {$data['name']} Email : {$data['email']} Message : {$data['message']} "; $headers = "From: {$data['email']}" . "\r\n" . "Reply-To: {$data['email']}" . "\r\n" . 'X-Mailer: PHP/' . phpversion(); // mail($to, $subject, $message); if (!mail($to, $subject, $message, $headers)) { $response = array( 'success'=>false, 'message'=>"Contact form could not be sent" ); return Response::json($response); } else { $response = array( 'success'=>true, 'message'=>"Contact form sent" ); return Response::json($response); } $msg = "Message Successfully Sent"; } else { $success = FALSE; $msg = "Invalid Email"; } $response = array( 'success'=>$success, 'message'=>$msg ); return Response::json($response); }); // Magazine Route::get('/magazine', function() { return View::make('site/magazine'); }); Route::get('/article/{slug}', function($slug) { $article = Article::where('slug', '=', $slug); if(params('showDraft')){ $article = $article->where('status', '=', 'Draft'); } else { $article = $article->where('status', '=', 'Published'); } $article = $article->first(); if ( is_null($article) ) App::abort(404); $article_view = str_replace('.blade.php', '', $article->view_file); // Return about us page $article_social_media_links = '
'; $page_title = $article->title ; return View::make('site/articles/'.$article_view,array( 'article' => $article, 'article_date' =>date("F, Y",strtotime($article->created_at)), 'article_social_media_links'=>$article_social_media_links, 'page_title'=>$page_title )); }); Route::get('/page/{slug}', function($slug) { $page = Page::where('slug', '=', $slug); if(params('showDraft')){ $page = $page->where('status', '=', 'Draft'); } else { $page = $page->where('status', '=', 'Published'); } $page = $page->first(); if ( is_null($page) ) App::abort(404); $page_view = str_replace('.blade.php', '', $page->view_file); $page_title = $page->title; return View::make('site/pages/'.$page_view,array( 'page' => $page, 'page_title'=>$page_title )); }); // Home Page. Route::get('/', function() { $posts = Post::where('status', '=', "Published") ->orderBy('created_at', 'desc') ->paginate(10); return View::make('site/home',array('posts'=>$posts)); }); // Map Route::get('/locator', function() { // Return about us page return View::make('site/locator'); }); //Slideshows Route::get('/getAlbum/{id}','SlideshowController@getAlbum'); Route::get('/galleries','SlideshowController@showGalleries'); Route::get('/slideshow/{id}','SlideshowController@showSlideshow'); Route::get('/slideshowTest/{id}','SlideshowController@showSlideshowTest'); //Used for image Uploads in admin Route::post('/upload', function() { $upload_field = params('input_field'); $upload_folder = params('upload_folder'); $file = Input::file($upload_field); // your file upload input field in the form should be named 'file' $destinationPath = 'uploads/'.$upload_folder; $filename = $file->getClientOriginalName(); //$extension =$file->getClientOriginalExtension(); //if you need extension of the file $uploadSuccess = $file->move($destinationPath, $filename); $response = array( 'image_location' => '/' . $destinationPath . '/' . $filename, ); if( $uploadSuccess ) { $response['status'] = 'success'; return Response::json($response, 200); // or do a redirect with some message that file was uploaded } else { $response['status'] = 'error'; return Response::json($response, 400); } }); //FEED Route::get('feed', function(){ // creating rss feed with our most recent 20 posts // $posts = DB::table('posts')->orderBy('created', 'desc')->take(20)->get(); $posts = Post::active()->where('status', '=', "Published") ->orderBy('created_at', 'desc')->get(); // ->paginate(10); $feed = Feed::make(); // set your feed's title, description, link, pubdate and language $feed->title = 'Twomag'; $feed->description = 'Twomag magazine feed'; $feed->logo = 'http://twomag.com/img/cog-logo.png'; $feed->link = URL::to('feed'); $feed->pubdate = $posts[0]->created_at; $feed->lang = 'en'; foreach ($posts as $post) { $user = DB::table('users')->where('id', '=', '1')->first(); // var_dump($user); // exit; $user_name = $post->author; $feed_specific = "
" . $post->feed_specific; // set item's title, author, url, pubdate and description $image_html = "
"; $feed->add($post->title, $user_name, URL::to($post->target_url), $post->created_at, $image_html . $post->main_content . $feed_specific); } // show your feed (options: 'atom' (recommended) or 'rss') return $feed->render('atom'); }); //ADmin Route::get('admin/logout', array('as' => 'admin.logout', 'uses' => 'App\Controllers\Admin\AuthController@getLogout')); Route::get('admin/login', array('as' => 'admin.login', 'uses' => 'App\Controllers\Admin\AuthController@getLogin')); Route::post('admin/login', array('as' => 'admin.login.post', 'uses' => 'App\Controllers\Admin\AuthController@postLogin')); Route::group(array('prefix' => 'admin', 'before' => 'auth.admin'), function() { Route::resource('articles', 'App\Controllers\Admin\ArticlesController'); Route::resource('pages', 'App\Controllers\Admin\PagesController'); Route::resource('posts', 'App\Controllers\Admin\BlogController'); // Route::resource('pages', 'App\Controllers\Admin\PagesController'); }); Whoops! There was an error.
5. Symfony\Component\HttpKernel\Exception\NotFoundHttpException
…/­bootstrap/­compiled.php4945
4. Illuminate\Routing\Router handleRoutingException
…/­bootstrap/­compiled.php4790
3. Illuminate\Routing\Router findRoute
…/­bootstrap/­compiled.php4778
2. Illuminate\Routing\Router dispatch
…/­bootstrap/­compiled.php483
1. Illuminate\Foundation\Application dispatch
…/­bootstrap/­compiled.php472
0. Illuminate\Foundation\Application run
/­var/­www/­vhosts/­twomag.com/­httpdocs/­index.php49

Symfony \ Component \ HttpKernel \ Exception \ NotFoundHttpException

            $value = new Response($value);
        }
        return $value->prepare($request);
    }
    protected function handleRoutingException(\Exception $e)
    {
        if ($e instanceof ResourceNotFoundException) {
            throw new NotFoundHttpException($e->getMessage());
        } elseif ($e instanceof MethodNotAllowedException) {
            $allowed = $e->getAllowedMethods();
    }
    protected function findRoute(Request $request)
    {
        try {
            $path = $request->getPathInfo();
            $parameters = $this->getUrlMatcher($request)->match($path);
        } catch (ExceptionInterface $e) {
            $this->handleRoutingException($e);
        }
        $route = $this->routes->get($parameters['_route']);
    public function dispatch(Request $request)
    {
        $this->currentRequest = $request;
        $response = $this->callGlobalFilter($request, 'before');
        if (!is_null($response)) {
            $response = $this->prepare($response, $request);
        } else {
            $this->currentRoute = $route = $this->findRoute($request);
            $response = $route->run($request);
        }
    }
    public function dispatch(Request $request)
    {
        if ($this->isDownForMaintenance()) {
            $response = $this['events']->until('illuminate.app.down');
            return $this->prepareResponse($response, $request);
        } else {
            return $this['router']->dispatch($this->prepareRequest($request));
        }
    }
            $this->fireAppCallbacks($this->shutdownCallbacks);
        } else {
            $this->shutdownCallbacks[] = $callback;
        }
    }
    public function run()
    {
        $response = $this->dispatch($this['request']);
        $this['router']->callCloseFilter($this['request'], $response);
        $response->send();
| Once we have the application, we can simply call the run method,
| which will execute the request and send the response back to
| the client's browser allowing them to enjoy the creative
| and wonderful applications we have created for them.
|
*/
 
$app->run();
 
/*
Key Value
PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
PP_CUSTOM_PHP_INI /var/www/vhosts/system/twomag.com/etc/php.ini
PP_CUSTOM_PHP_CGI_INDEX plesk-php53-fastcgi
FCGI_ROLE RESPONDER
REDIRECT_UNIQUE_ID WtrtPm2WwFBhZvik5VcH9AAAAIE
REDIRECT_STATUS 200
UNIQUE_ID WtrtPm2WwFBhZvik5VcH9AAAAIE
HTTP_HOST twomag.com
HTTP_X_REAL_IP 54.198.78.121
HTTP_X_ACCEL_INTERNAL /internal-nginx-static-location
HTTP_CONNECTION close
HTTP_ACCEPT_ENCODING x-gzip, gzip, deflate
HTTP_USER_AGENT CCBot/2.0 (http://commoncrawl.org/faq/)
HTTP_ACCEPT text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
SERVER_SIGNATURE
SERVER_SOFTWARE Apache
SERVER_NAME twomag.com
SERVER_ADDR 216.70.109.227
SERVER_PORT 80
REMOTE_ADDR 54.198.78.121
DOCUMENT_ROOT /var/www/vhosts/twomag.com/httpdocs
REQUEST_SCHEME http
CONTEXT_PREFIX
CONTEXT_DOCUMENT_ROOT /var/www/vhosts/twomag.com/httpdocs
SERVER_ADMIN pdiantoni@gmail.com
SCRIPT_FILENAME /var/www/vhosts/twomag.com/httpdocs/index.php
REMOTE_PORT 41342
REDIRECT_URL /article/endure
GATEWAY_INTERFACE CGI/1.1
SERVER_PROTOCOL HTTP/1.0
REQUEST_METHOD GET
QUERY_STRING
REQUEST_URI /article/endure
SCRIPT_NAME /index.php
PHP_SELF /index.php
REQUEST_TIME 1524297022
empty
empty
empty
empty
Key Value
_sf2_attributes Array ( [_token] => 8K8z5HIw7v562fkkxdJIBtVbCKzZWCRhDks6ZWYG )
_sf2_flashes Array ( )
_sf2_meta Array ( [u] => 1524297022 [c] => 1524297022 [l] => 7200 )
empty
0. Whoops\Handler\PrettyPageHandler