filter('before', 'auth'); } public function action_set_category() { $takeaway = Takeaway::find(Input::get('id')); $category = Category::find(Input::get('category_id')); if ($takeaway && $category) { $takeaway->add_categories(array($category->id)); } $takeaway->action('category'); $takeaway->flush_cache(); } public function action_flush_cache($url) { // Get the ID from the URL and the takeaway object $segments = explode('-', $url); $id = end($segments); $takeaway = Takeaway::find($id); $takeaway->flush_cache(true); return Redirect::to($takeaway->get_url()); } public function action_status($id) { $takeaway = Takeaway::find($id); return View::make('manage.status', array('takeaway' => $takeaway)); } public function action_takeaway($url, $extra = false) { // Get the ID from the URL and the takeaway object $segments = explode('-', $url); $id = end($segments); $takeaway = Takeaway::find($id); $town = $takeaway->Towns()->first(); // 404 if it doesnt exist if (!$takeaway) return Response::error('404'); // This takeaway belongs to the logged in user if (!$takeaway->user_id && Auth::user()->id != $takeaway->user_id) return Redirect::to($takeaway->get_url(false, 'claim')); // Setup GoCardless include_once path('app').'libraries/GoCardless.php'; $account_details = array( 'app_id' => 'Z7PZATB53B686HW6KYRHKH0STH4DWCZRDYFAVQRFB20AR0M80ZCT020D1ENH906H', 'app_secret' => '1N12AF1ZNB5D25N7WHHYA0N9D1H5R78ZPT804MBKVWVKVPHX6Y9T3K8YYYDM20C2', 'merchant_id' => '0DNWDFQ01V', 'access_token' => 'EFQ7G9T05CE8PGJKA0HQWF135WJST6NH3CAM6JXB88NGVQ5X5KR9D4DAMD12MX8B' ); GoCardless::$environment = 'production'; GoCardless::set_account_details($account_details); $successes = array(); $errors = array(); if ($extra == 'canceled') { // Nothing } else if (in_array($extra, array('one_month', 'three_months', 'six_months'))) { // Verify the payment try { $confirm_result = GoCardless::confirm_resource(Input::all()); mail( 'email@takeaway-finder.co.uk', 'New promotion!!', $takeaway->get_url(true).' has been promoted for: '.$extra.PHP_EOL. print_r($confirm_result, true) ); $takeaway->subscription_id = $confirm_result->id; $takeaway->promoted = 1; $takeaway->save(); $successes[] = "Thanks, {$takeaway->name} is now promoted!"; } catch(Exception $e) { mail( 'email@takeaway-finder.co.uk', 'ERROR PROMOTING!!', print_r($e, true) ); $errors[] = "Sorry, there was a problem, we've notified our team and we'll investigate it."; } } if (Request::method() == 'POST') { $takeaway->email_edit = Input::get('email_edit', 0); $takeaway->email_review = Input::get('email_review', 0); $takeaway->allow_public_edit = Input::get('allow_public_edit', 0); $takeaway->save(); $successes[] = 'Your changes have been saved.'; } $promotions = $takeaway->Promotions()->get(); $town = $takeaway->Towns()->first(); // Get the payment URLS // List all the payment URLs $urls = array(); $urls['one_month'] = GoCardless::new_subscription_url(array( 'amount' => '10.00', 'interval_length' => 1, 'interval_unit' => 'month', 'redirect_uri' => $takeaway->get_url(true, 'manage', 'one_month'), 'cancel_uri' => $takeaway->get_url(true, 'manage', 'canceled') )); $urls['three_months'] = GoCardless::new_subscription_url(array( 'amount' => '25.00', 'interval_length' => 3, 'interval_unit' => 'month', 'redirect_uri' => $takeaway->get_url(true, 'manage', 'three_months'), 'cancel_uri' => $takeaway->get_url(true, 'manage', 'canceled') )); $urls['six_months'] = GoCardless::new_subscription_url(array( 'amount' => '50.00', 'interval_length' => 6, 'interval_unit' => 'month', 'redirect_uri' => $takeaway->get_url(true, 'manage', 'six_months'), 'cancel_uri' => $takeaway->get_url(true, 'manage', 'canceled') )); // Get the subscription info /* if ($takeaway->subscription_id) { $subscription = GoCardless_Subscription::find($takeaway->subscription_id); dd($subscription); } */ return View::make('manage.takeaway')->with(array( 'takeaway' => $takeaway, 'promotions' => $promotions, 'town' => $town, 'successes' => $successes, 'errors' => $errors, 'urls' => $urls )); } public function action_claim( $url, $confirm = false ) { // Get the ID from the URL and the takeaway object $segments = explode('-', $url); $id = end($segments); $takeaway = Takeaway::find($id); $town = $takeaway->Towns()->first(); // 404 if it doesnt exist if (!$takeaway) return Response::error('404'); // This takeaway belongs to the logged in user if ($takeaway->user_id && Auth::user()->id == $takeaway->user_id) return Redirect::to($takeaway->get_url(false, 'manage')); // User is logged in, and wants to claim this unclaimed takeaway if (Auth::check() && $confirm == 'confirm' && !$takeaway->user_id) { $takeaway->user_id = Auth::user()->id; $takeaway->save(); return Redirect::to($takeaway->get_url(false, 'manage')); } // User is logged in, and wants to claim this takeaway, but it belongs to someone else if (Auth::check() && $confirm == 'confirm' && $takeaway->user_id && $takeaway->user_id != Auth::user()->id) { // Shizzen } Session::put( 'return_url', $takeaway->get_url(false, 'claim') ); return View::make('manage.claim')->with(array( 'takeaway' => $takeaway, 'town' => $town, 'user' => Auth::check() ? Auth::user() : false )); } }

Unhandled Exception

Message:

Class 'Manage_Controller' not found

Location:

/home/forge/takeaway-finder.co.uk/laravel/routing/controller.php on line 226

Stack Trace:

#0 /home/forge/takeaway-finder.co.uk/laravel/routing/controller.php(145): Laravel\Routing\Controller::resolve('application', 'Manage_Controll...')
#1 /home/forge/takeaway-finder.co.uk/laravel/routing/route.php(153): Laravel\Routing\Controller::call('manage@takeaway', Array)
#2 /home/forge/takeaway-finder.co.uk/laravel/routing/route.php(124): Laravel\Routing\Route->response()
#3 /home/forge/takeaway-finder.co.uk/laravel/laravel.php(125): Laravel\Routing\Route->call()
#4 /home/forge/takeaway-finder.co.uk/public_html/index.php(34): require('/home/forge/tak...')
#5 {main}