PHP

Laravel Object Clone

Nice little laravel clone function. Extending the base elquent model for your self is generally best practice.

Then you can whack function little helper functions in there like this.

  public function __clone() {

        $clone = new self($this->to_array());

        unset( $clone->id );

        $clone->exists = false;

        return $clone;

    }

Read more →

Joomla 1.5 Component with Jquery and Mootools

I’ve been building a component for Joomla 1.5 and I really wanted to use Jquery in the admin over Mootools. Unfortunately Googling for this answer is tricky as so many people are posting examples how to remove Joomla js from their frontend template. The following is very ‘hacky’ but if you’re feed up with the Joomla API and want to throw together a component, without mootools, it’s useful. It stops the need to export jQuery into a different name space, therefore breaking 3rd party jQuery plugins.

Read more →