标签:sharp something 一个 UNC pre function 服务 绑定 echo
建立一个服务
<?php namespace App\Services; class FooService { public function __construct(){ } public function doSomething(){ echo "some"; } }
绑定服务
$this->app->bind(‘\App\Services\FooService‘);
在控制器里调用
$fooService = app()->make(‘\App\Services\FooService‘);
$fooService->doSomething();
标签:sharp something 一个 UNC pre function 服务 绑定 echo
原文地址:https://www.cnblogs.com/vania/p/11855698.html