Skip to content

Instantly share code, notes, and snippets.

View kingpabel's full-sized avatar

Imtiaz Ahmed kingpabel

View GitHub Profile
@kingpabel
kingpabel / ClearBeanstalkdQueue.php
Created December 18, 2016 12:13
Laravel 5.1 compatible command which allows to clear Beanstalkd queue.
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Queue\Connectors\BeanstalkdConnector;
use Pheanstalk\Pheanstalk;
class ClearBeanstalkdQueue extends Command
{
@kingpabel
kingpabel / gist:f22649ca19ccfb99ecfe
Last active August 29, 2015 14:28 — forked from dominicmartineau/gist:5957140
Laravel 4: How to redirect to 404 page after exception thrown. Simply add a redirect to your 404 page at the end of 'App::error()' into app/start/global.php. You should return to your 404 page only if debug is not enabled.
App::error(function(Exception $exception, $code)
{
Log::error($exception);
if (Config::get('app.debug') == false) {
return Redirect::route('404');
}
});