問題描述 使用 illuminate/database 之后 通過命令 php webman make:model AuthRole 生成的model 如圖: 查詢語句: $role = AuthRole::where(['status'=>1])->pluck('name','id'); 報錯: PDOException: SQLSTATE[42S02]: Base table or view no...
問題描述 使用 Eloquant 定義了一個 Model,根據(jù)文檔和測試寫入一行記錄。數(shù)據(jù)行插入但是不符合預期。 這個是我的 Model 文件 <?php namespace app\model; use support\Model; class Staff extends Model { /** * The table associated with the model. ...
redis 配置改成 dotenv 獲取配置的話,密碼認證默認值傳 null 會報錯, 需要改成空字符串 return [ 'default' => [ 'host' => getenv('redis_host', '127.0.0.1'), 'password' => getenv('redis_password', ''), 'port' ...
問題描述 按照文檔上一步步走下來的,但是好像數(shù)據(jù)庫連接失敗了 程序代碼 查詢代碼 $name = Db::table('tb_park')->where('id', 1)->value('name'); return response("hello $name"); 數(shù)據(jù)庫配置文件 // 默認數(shù)據(jù)庫 'default' => 'mysql', 'mysql' => [...
Fatal error: Uncaught Error: Class "PhpOption\Option" not found in C:\Users \Desktop\zz\code\api\vendor\illuminate\support\Env.php:76 Stack trace: #0 C:\Users\Desktop\zz\code\api\vendor\illuminate\support\helpe...