Created
March 6, 2020 12:54
-
-
Save atsu666/dd8859971bd05bf9b2daecfc9a3e0a3a to your computer and use it in GitHub Desktop.
php/Services/Preview/PreviewServiceProvider.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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