错误:FatalErrorException in BillingServerProvider.php line 27:
Class 'App\Providers\LoginAdmin' not found
ServerProvider.php:
public function register()
{
$this->app->bind('Billing',function(){
return new LoginAdmin();
});
}
Login.php
<?php
namespace App\Billing;
class LoginAdmin{
public $name;
public $password;
public function __construct($name='',$password='')
{
$this->name = $name;
$this->password = $password;
}
public function Account(){
if(isset($this->name)&&!empty($this->name)){
return $this->name;
}else{
return $this->name = '';
}
}
}
?>
控制器:
$login = app('Billing');
dd($login);