I'm trying to understand the new documentation for flarum 2.x, and is not clear to me how to serialize and create controllers.
what i have so far:
- new migration that add a new table
- a new model like this
class MyClass extends AbstractModel
{
use ScopeVisibilityTrait, EventGeneratorTrait;
protected $table = 'mytablename';
protected $fillable = ['user_id', 'mytablename'];
public function user()
{
return $this->belongsTo(User::class, 'user_id');
}
}
what i need is, how should i serialize my new model and how can i create the new CRUD endpoint? docs are not clear.
since there is no more AbstractCreate, AbstractListing etc, i need to create simply a class that implements RequestHandlerInterface?