PHP code example of earlybirdmvp / foundry

1. Go to this page and download the library: Download earlybirdmvp/foundry library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

earlybirdmvp / foundry example snippets


View::addLocation(base_path().'/vendor/earlybirdmvp/foundry/views');
View::addNamespace('foundry', base_path().'/vendor/earlybirdmvp/foundry/views');

class Product extends Eloquent {
    use Earlybird\Foundry;
}

class ProductController extends BaseController {
    use Earlybird\FoundryController;
}

Route::resource('product', 'ProductController');

class Product extends Eloquent {
    use Earlybird\Foundry;

    protected $rules = array(
        'name' => 'min:8'
    );
}

class Product extends Eloquent {
    use Earlybird\Foundry;

    public function category() {
        return $this->belongsTo('Category');
    }
}

class Product extends Eloquent {
    use Earlybird\Foundry;

    protected $appends = array(
        'foundry_value',
    );
    public function getFoundryValueAttribute() {
        return $this->sku . ':  ' . $this->name;
    }
}

class OrderController extends BaseController {
    use Earlybird\FoundryController;

    public function detectChange() {
        // Email customer update that order status was changed
    }
}