Fresa

Fresa

Developing WordPress should be sweet.


composer require jplhomer/fresa
                        

Latest Release: v1.1.2

Fresa embraces the existing WordPress API and extends it into a set of fluent, configurable interfaces.


Models Save You Keystrokes

Extend a single base class to get started using the power of Fresa's PostModel class. Register a custom post type in one line instead of 30.

use Fresa\PostModel;

class Event extends PostModel
{
    protected $postType = 'event';
}

Event::register();

Object-Oriented Programming in WordPress

Set default WordPress properties with a shorter syntax. Assign meta values in a single line. Persist all of your data with a single method.

$event = new Event;
$event->title = 'A Fun Party';
$event->content = 'Come hang with us!';
$event->venue = 'Central Park';
$event->save();

Query Models With Ease

Leverage Fresa's model syntax to perform fluent queries of existing WordPress data. Apply limits, orders and offsets in the same query. Iterate over results returned as Collection instances.

$events = Event::where('venue', 'Central Park')
    ->order('start', 'asc')
    ->limit(5)
    ->offset(5)
    ->get();

foreach ($events as $event) {
    echo $event->title;
}

Ready to get started?

Check out the full documentation.

Documentation

Fresa Updates

Get notified of new features