laravel 的模型
建立model文件,再项目的app目录下建立Member.php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Member extends Model
{
public static function getHello(){
return 'hello model';
}
}
使用控制器调用
namespace App\Http\Controllers;
use App\Member;
class MemberController extends Controller
{
public function hello_test(){
return Member::getHello();
}
}