Skip to content
This repository was archived by the owner on May 9, 2019. It is now read-only.

bavix/laravel-helpers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

laravel helpers

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