carsonlius

3482 经验值

nice! 但是视频存储怕是要耗费不少的资源

发布版本 或者composer require your/package dev-master

是的 这一评论我已经编辑过了 就是不知道怎么没有生效

建议还是收费 毕竟网站的维护还是需要费用的!服务器,其他的各种服务; 这个如果完全免费的话 这个站点还能维持多久? 为了长久一些 希望还是收费

  • laravel官方文档

    • 使用延迟加载的时候,需要配置defer属性和 providers 方法 , 但是没有搞东provides 方法怎么填写, 下面这样写可以吗? 没有报错,但是感觉文档不是这个意思

<?php

namespace App\Providers;

use App\Billing\Stripe;
use Illuminate\Support\ServiceProvider;

class BillServiceProvider extends ServiceProvider
{
    /**
     * Indicates if loading of the provider is deferred.
     *
     * @var bool
     */
    protected $defer = true;

    /**
     * Bootstrap the application services.
     *
     * @return void
     */
    public function boot()
    {
    }

    /**
     * Register the application services.
     *
     * @return void
     */
    public function register()
    {
        $this->app->singleton('billing', function($app){
           return new Stripe();
        });
    }

    /**
     * Get the services provided by the provider.
     *
     * @return array
     */
    public function provides()
    {
        return [Stripe::class];
    }
}

延迟加载 参考了HashServiceProvider 和官方文档
To defer the loading of a provider, set the defer property to true and define a provides method. The provides method should return the service container bindings registered by the provider: ·

<?php

namespace App\Providers;

use App\Billing\Stripe;
use Illuminate\Support\ServiceProvider;

class BillServiceProvider extends ServiceProvider
{
    /**
     * Indicates if loading of the provider is deferred.
     *
     * @var bool
     */
    protected $defer = true;

    /**
     * Bootstrap the application services.
     *
     * @return void
     */
    public function boot()
    {
    }

    /**
     * Register the application services.
     *
     * @return void
     */
    public function register()
    {
        $this->app->singleton('billing', function($app){
           return new Stripe();
        });
    }

    /**
     * Get the services provided by the provider.
     *
     * @return array
     */
    public function provides()
    {
        return ['billing'];
    }
}