Database & Models

Manage data persistence in your Senddera plugins with custom migrations and Eloquent models.

Database Management

Plugins can manage their own database schema using standard migrations. Senddera automatically looks for migrations within your plugin's database/migrations directory.

Creating Migrations

Use the artisan command to generate migrations specifically for your plugin:

php artisan senddera:make-migration create_my_table --plugin=MyPlugin

Models

Define Eloquent models within your plugin to interact with your custom tables. Ensure you use the correct namespace according to your plugin's structure.

namespace Plugins\MyPlugin\Models;

use Illuminate\Database\Eloquent\Model;

class MyModel extends Model
{
    protected $table = 'my_plugin_table';
}