建立model文件,再项目的app目录下建立Member.php
namespace App;
use IlluminateDatabaseEloquentModel;
class Member extends Model
{
public static function getHello(){
return 'hello model';
}
}
使用控制器调用
namespace AppHttpControllers;
use AppMember;
class MemberController extends Controller
{
public function hello_test(){
return Member::getHello();
}
}