Skip to content

Instantly share code, notes, and snippets.

@atsu666
Created March 6, 2020 12:54
Show Gist options
  • Save atsu666/dd8859971bd05bf9b2daecfc9a3e0a3a to your computer and use it in GitHub Desktop.
Save atsu666/dd8859971bd05bf9b2daecfc9a3e0a3a to your computer and use it in GitHub Desktop.
php/Services/Preview/PreviewServiceProvider.php
<?php
namespace Acms\Services\Preview;
use Acms\Contracts\ServiceProvider;
use Acms\Services\Container;
class PreviewServiceProvider extends ServiceProvider
{
/**
* register service
*
* @param \Acms\Services\Container $container
*
* @return void
*/
public function register(Container $container)
{
$container->singleton('preview', function () {
$lifetime = 60 * 60 * intval(config('url_preview_expire', 48));
return new Engine($lifetime, BASE_URL . "admin/preview_share/");
});
}
/**
* initialize service
*
* @return void
*/
public function init()
{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment