App下載

詞條

大約有 7,000 項符合查詢結(jié)果 ,庫內(nèi)數(shù)據(jù)總量為 78,250 項。(搜索耗時:0.0046秒)

5421.Laravel 8 發(fā)布與訂閱

...為調(diào)用 subscribe 方法會啟動一個長時間運行的進(jìn)程:<?php namespace App\Console\Commands; use Illuminate\Console\Command; use Illuminate\Support\Facades\Redis; class RedisSubscribe extends Command { /** * 控制臺命令的名稱和簽名 * * @var string */ protected $signature = ...

http://www.o2fo.com/laravel_8/laravel_8-epv13i0p.html

5422.Laravel 8 簡介

...據(jù)表中插入新記錄。在開始之前,請確保在 config/database.php 中配置數(shù)據(jù)庫連接。更多關(guān)于數(shù)據(jù)庫配置的信息,請查看 文檔。

http://www.o2fo.com/laravel_8/laravel_8-5cv43i0s.html

5423.Laravel 8 Eloquent 模型約定

現(xiàn)在,我們來看一個 Flight 模型的示例,我們將用它從 flights 數(shù)據(jù)庫表中檢索和存儲數(shù)據(jù)信息:<?php namespace App\Models; use Illuminate\Database\Eloquent\Model; class Flight extends Model { // }

http://www.o2fo.com/laravel_8/laravel_8-y5ki3i0u.html

5424.Laravel 8 數(shù)據(jù)表名稱

...以通過在模型上定義 table 屬性來指定自定義數(shù)據(jù)表:<?php namespace App\Models; use Illuminate\Database\Eloquent\Model; class Flight extends Model { /** * 與模型關(guān)聯(lián)的表名 * * @var string */ protected $table = 'my_flights'; }

http://www.o2fo.com/laravel_8/laravel_8-rtkz3i0v.html

5425.Laravel 8 默認(rèn)屬性值

...屬性定義默認(rèn)值,可以在模型上定義 $attributes 屬性:<?php namespace App\Models; use Illuminate\Database\Eloquent\Model; class Flight extends Model { /** * 模型屬性的默認(rèn)值 * * @var array */ protected $attributes = [ 'delayed' => false, ]; }

http://www.o2fo.com/laravel_8/laravel_8-2mhw3i0z.html

5426.Laravel 8 模型檢索

...可以用它更快速的查詢與其相關(guān)聯(lián)的數(shù)據(jù)表。例如:<?php $flights = App\Models\Flight::all(); foreach ($flights as $flight) { echo $flight->name; }

http://www.o2fo.com/laravel_8/laravel_8-mq683i12.html

5427.Laravel 8 數(shù)據(jù)庫連接

...模型指定一個不同的連接,設(shè)置 $connection 屬性即可:<?php namespace App\Models; use Illuminate\Database\Eloquent\Model; class Flight extends Model { /** * 模型的數(shù)據(jù)庫連接名 * * @var string */ protected $connection = 'connection-name'; }

http://www.o2fo.com/laravel_8/laravel_8-36et3i14.html

5428.Laravel 8 插入

...新模型實例,給實例設(shè)置屬性,然后調(diào)用 save 方法:<?php namespace App\Http\Controllers; use App\Http\Controllers\Controller; use App\Models\Flight; use Illuminate\Http\Request; class FlightController extends Controller { /** * 創(chuàng)建一個新實例 * * @param Request $request...

http://www.o2fo.com/laravel_8/laravel_8-4rak3i1c.html

5429.Laravel 8 軟刪除

...在模型上使用 Illuminate\Database\Eloquent\SoftDeletes trait:<?php namespace App\Models; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; class Flight extends Model { use SoftDeletes; } 技巧:SoftDeletes 會自動將 deleted_at 屬性轉(zhuǎn)換成 DateT...

http://www.o2fo.com/laravel_8/laravel_8-p7jx3i1m.html

5430.Laravel 8 批量賦值

...。 例如:讓 Flight 模型的 name 屬性可以被批量賦值:<?php namespace App\Models; use Illuminate\Database\Eloquent\Model; class Flight extends Model { /** * 可批量賦值屬性 * * @var array */ protected $fillable = ['name']; } 一旦我們設(shè)置好了可以批量賦值...

http://www.o2fo.com/laravel_8/laravel_8-ft5u3i1r.html

抱歉,暫時沒有相關(guān)的微課

w3cschool 建議您:

  • 檢查輸入的文字是否有誤

抱歉,暫時沒有相關(guān)的視頻課程

w3cschool 建議您:

  • 檢查輸入的文字是否有誤

抱歉,暫時沒有相關(guān)的教程

w3cschool 建議您:

  • 檢查輸入的文字是否有誤

5421.Laravel 8 發(fā)布與訂閱

...為調(diào)用 subscribe 方法會啟動一個長時間運行的進(jìn)程:<?php namespace App\Console\Commands; use Illuminate\Console\Command; use Illuminate\Support\Facades\Redis; class RedisSubscribe extends Command { /** * 控制臺命令的名稱和簽名 * * @var string */ protected $signature = ...

http://www.o2fo.com/laravel_8/laravel_8-epv13i0p.html

5422.Laravel 8 簡介

...據(jù)表中插入新記錄。在開始之前,請確保在 config/database.php 中配置數(shù)據(jù)庫連接。更多關(guān)于數(shù)據(jù)庫配置的信息,請查看 文檔。

http://www.o2fo.com/laravel_8/laravel_8-5cv43i0s.html

5423.Laravel 8 Eloquent 模型約定

現(xiàn)在,我們來看一個 Flight 模型的示例,我們將用它從 flights 數(shù)據(jù)庫表中檢索和存儲數(shù)據(jù)信息:<?php namespace App\Models; use Illuminate\Database\Eloquent\Model; class Flight extends Model { // }

http://www.o2fo.com/laravel_8/laravel_8-y5ki3i0u.html

5424.Laravel 8 數(shù)據(jù)表名稱

...以通過在模型上定義 table 屬性來指定自定義數(shù)據(jù)表:<?php namespace App\Models; use Illuminate\Database\Eloquent\Model; class Flight extends Model { /** * 與模型關(guān)聯(lián)的表名 * * @var string */ protected $table = 'my_flights'; }

http://www.o2fo.com/laravel_8/laravel_8-rtkz3i0v.html

5425.Laravel 8 默認(rèn)屬性值

...屬性定義默認(rèn)值,可以在模型上定義 $attributes 屬性:<?php namespace App\Models; use Illuminate\Database\Eloquent\Model; class Flight extends Model { /** * 模型屬性的默認(rèn)值 * * @var array */ protected $attributes = [ 'delayed' => false, ]; }

http://www.o2fo.com/laravel_8/laravel_8-2mhw3i0z.html

5426.Laravel 8 模型檢索

...可以用它更快速的查詢與其相關(guān)聯(lián)的數(shù)據(jù)表。例如:<?php $flights = App\Models\Flight::all(); foreach ($flights as $flight) { echo $flight->name; }

http://www.o2fo.com/laravel_8/laravel_8-mq683i12.html

5427.Laravel 8 數(shù)據(jù)庫連接

...模型指定一個不同的連接,設(shè)置 $connection 屬性即可:<?php namespace App\Models; use Illuminate\Database\Eloquent\Model; class Flight extends Model { /** * 模型的數(shù)據(jù)庫連接名 * * @var string */ protected $connection = 'connection-name'; }

http://www.o2fo.com/laravel_8/laravel_8-36et3i14.html

5428.Laravel 8 插入

...新模型實例,給實例設(shè)置屬性,然后調(diào)用 save 方法:<?php namespace App\Http\Controllers; use App\Http\Controllers\Controller; use App\Models\Flight; use Illuminate\Http\Request; class FlightController extends Controller { /** * 創(chuàng)建一個新實例 * * @param Request $request...

http://www.o2fo.com/laravel_8/laravel_8-4rak3i1c.html

5429.Laravel 8 軟刪除

...在模型上使用 Illuminate\Database\Eloquent\SoftDeletes trait:<?php namespace App\Models; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; class Flight extends Model { use SoftDeletes; } 技巧:SoftDeletes 會自動將 deleted_at 屬性轉(zhuǎn)換成 DateT...

http://www.o2fo.com/laravel_8/laravel_8-p7jx3i1m.html

5430.Laravel 8 批量賦值

...。 例如:讓 Flight 模型的 name 屬性可以被批量賦值:<?php namespace App\Models; use Illuminate\Database\Eloquent\Model; class Flight extends Model { /** * 可批量賦值屬性 * * @var array */ protected $fillable = ['name']; } 一旦我們設(shè)置好了可以批量賦值...

http://www.o2fo.com/laravel_8/laravel_8-ft5u3i1r.html

抱歉,暫時沒有相關(guān)的文章

w3cschool 建議您:

  • 檢查輸入的文字是否有誤

熱門課程