You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you have installed as a regular user, the Apache user is the same that your user. If you have installed as root user, the default > > Apache user is "daemon". I hope it helps.
<?phpnamespaceApp;
useIlluminate\Database\Eloquent\Model;
class Flight extends Model
{
//
}
這裡有幾個規則:
table的名稱會是你的model的復數型。以例子來說,table名稱為flights。
可以在model中定義table名稱:
<?phpnamespaceApp;
useIlluminate\Database\Eloquent\Model;
class Flight extends Model
{
/** * The table associated with the model. * * @var string */protected$table = 'my_flights';
}
<?phpnamespaceApp;
useIlluminate\Database\Eloquent\Model;
class Flight extends Model
{
/** * Indicates if the model should be timestamped. * * @var bool */public$timestamps = false;
}
自定義格式:
<?phpnamespaceApp;
useIlluminate\Database\Eloquent\Model;
class Flight extends Model
{
/** * The storage format of the model's date columns. * * @var string */protected$dateFormat = 'U';
}
"Before using Laravel's encrypter, you must set a key option in your config/app.php configuration file. You should use the php artisan key:generate command to generate this key"
因此,解決這問題,應該使用指令:php artisan key:generate即可解決。
但是使用這個指令時,又遇到另一個問題:產生 no .env file error。
搜尋了一下,大部份的人遇到這個問題都是因為沒有把.env.example範例檔修改為.env,
但我目前實作的資料夾連.env 檔都沒有。
現在嘗試刪掉專案重新建立…
Means
7 - Owner can write
7 - Group can write
5 - Others cannot write!
If your webserver is not running as Vagrant, it will not be able to write to it, so you have 2 options:
chmod -R 777 storage
or change the group to your webserver user, supposing it's www-data:
<?phpnamespaceApp;
useIlluminate\Database\Eloquent\Model;
class Flight extends Model
{
/** * The attributes that are mass assignable. * * @var array */protected$fillable = ['name'];
}
The given object must be an implementation of the Illuminate\Contracts\Auth\Authenticatable contract. Of course, the App\User model included with Laravel already implements this interface:
webpack的設定檔,resolve.alias
別名的路徑,他不認識上一層(
../
),經過我好多次的實驗,應該是這樣 = =它可以指定當前目錄(
./
),但沒辦法返回上一層