duanhu7400
duanhu7400
2018-06-13 23:05
浏览 59
已采纳

Laravel 5.5存储链调用添加dir文件过滤类

Edited. sorry all the class code is bugged

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dougu5950
    dougu5950 2018-06-14 02:20
    已采纳

    You should use static function. Try replace your function as code below.

     public static function disk($disk)
     {
         $instance = new MyStorage();
         $instance->disk = $disk;
         return $instance;
    

    Furthermore, I would suggest you learn singleton design pattern

    点赞 评论

相关推荐