11 2023 档案
摘要:一,主表book class Book extends Model{ // protected $fillable=['title','price','num']; public function bookCard(){ return $this->hasOne(BookCard::class);
阅读全文
摘要:1,创建模型 php artisan make:model Book -m创建模型book 并生成迁移文件 2,Book迁移文件 public function up(){ Schema::create('books', function (Blueprint $table) { $table->i
阅读全文
摘要:1,创建中间件 php artisan make:middleware Activery 2,中间写过滤 public function handle($request, Closure $next){ if($request->age<20){ return redirect('home'); }
阅读全文