Skip to content

Instantly share code, notes, and snippets.

View alnutile's full-sized avatar

Alfred Nutile alnutile

View GitHub Profile
<?php namespace BehatEditor\Providers;
use App, URL;
use Illuminate\Routing\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider {
/**
* Called before routes are registered.
*
@alnutile
alnutile / FeatureContext.php
Created September 22, 2014 20:35
Using this to fill in the wysiwyg hidden input
/**
* @Then /^I fill in wysiwyg on field "([^"]*)" with "([^"]*)"$/
*/
public function iFillInWysiwygOnFieldWith($arg, $arg2)
{
$js = <<<HEREDOC
jQuery("textarea[name='$arg']").css('visibility', 'visible');
jQuery("textarea[name='$arg']").show();
HEREDOC;
$this->getSession()->executeScript($js);
<?php namespace BehatEditor\Http\Filters;
use Illuminate\Http\Request;
use Illuminate\Routing\Route;
use Auth, Redirect, Response;
class AuthFilter {
/**
* Run the request filter.
protected function addToQueue($results_of_job_insert)
{
//1. Setup the Class Name
$class = 'BehatEditor\Reporting\ReportingOverviewJob';
//2. Setup the queue name
$queue_name = $_ENV["BEAN_QUEUE_REPORTING_OVERVIEW"];
//3. Setup the data attributes adding the uuid of the related ReportJobsTable
$data = [
'related_job' => $results_of_job_insert->id,
];

First I call in the queue and load it into a service

custom_start.php:154

$env = $core->getEnv();
require_once $core->getAppPath() . "/config/{$env}/queue.php";

$core->setQueueLogging();
@alnutile
alnutile / custom_start.php
Created August 28, 2014 20:04
Here is how I clear the route now via an example url
/**
* In this example we get the next job in the Queue
* Considering it is the job and class
* \Foo\ExampleQueueIlluminateHandler@fire
* you can see things there and in the logs
*/
$core->getApp()->get('/get_job_illuminate', function() use ($core){
try {
$results = $core->getApp()['queue.illuminate.worker']->pop('default', $core->getApp()['queue.illuminate.queue_name'], 3, 64, 30, 0);
return $core->getApp()->json("Job Cleared " . $results['job']->getJobId());
"property_types": [
        {
        "id": "1",
        "name": "Industrial",
        "pivot": {
            "property_type_taggable_id": "5",
            "property_type_id": "1"
          }
 },
<?php
/**
* Created by PhpStorm.
* User: alfrednutile
* Date: 8/27/14
* Time: 11:04 AM
*/
namespace BehatEditor;
<?php
/**
* Created by PhpStorm.
* User: alfrednutile
* Date: 8/27/14
* Time: 11:04 AM
*/
namespace BehatEditor;
@alnutile
alnutile / example.md
Last active August 29, 2015 14:05
Example Layout
  1. Example with you having a Namespace in your module / <--module root /src/Foo <--This is your namespace folder

This is now your composer

"require": {
 "php": "&gt;=5.4.0",