Nodejs, PHP, ExpressJs, MySql, MongoDB

Showing: 1 - 1 of 1 RESULTS
CSS Laravel MySql PHP RESTFull Web Development Website XAMPP

Laravel: Get Newest/Oldest Records from Pivot Table in BelongsToMany

Default belongsToMany relationship in Laravel works really well – you can easily attach, detach or sync records. But what if you want to order pivot records by newest or oldest? This article will show you how. Here’s how default pivot table is described. Migration file: class CreateProjectUserPivotTable extends Migration { public function up() { Schema::create(‘project_user’, …

  • twitter
  • facebook
  • instagram
  • linkedin