bavix/laravel-helpers

Language Helpers for Laravel 5

1.2.2 2019-01-29 12:59 UTC

README

Set of often used assistants

Corundum (SDK)

Corundum (SDK) is a set of adapters which are able to change the image sizes by rules: fit, none, cover, contain, resize.

Image of Sizes

$slice = new \Bavix\Slice\Slice([
    'disk'   => 'public',
    'driver' => 'gd'
]);

$corundum = new \Bavix\Helpers\Corundum\Corundum($slice);
$adapter  = new \Bavix\Helpers\Corundum\Adapters\Contain(
    $corundum,
    __DIR__ . '/images/test.png'
);

$slice = new Bavix\Slice\Slice([
    'width'  => '600',
    'height' => '600',
    'color'  => '#f00'
]);

$adapter->apply($slice)
    ->save(__DIR__ . '/images/none.png');

Model URL

use Bavix\Extensions\ModelURL;

class File extends Model
{
    use ModelURL;
    
    protected $route = 'file';
    
    // ...
}

helpers

  • cookies
    • bx_decrypt($mixed)
    • bx_cookie($key, $default = null)
  • functions
    • bx_swap($first, $second)
  • uploads
    • bx_uploaded_file()

Supported by

Supported by JetBrains