Skip to content

Commit

Permalink
add migration and model for campaigns.
Browse files Browse the repository at this point in the history
  • Loading branch information
suraj-webkul committed Nov 4, 2024
1 parent e16223b commit dd467c9
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
public function up(): void
{
Schema::create('marketing_events', function (Blueprint $table) {
$table->id();
$table->increments('id');
$table->string('name');
$table->string('description');
$table->date('date');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,25 @@

return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('marketing_campaigns', function (Blueprint $table) {
$table->id();
$table->increments('id');
$table->string('name');
$table->string('subject');
$table->boolean('status')->default(0);
$table->string('type');
$table->string('mail_to');
$table->string('spooling')->nullable();
$table->unsignedInteger('marketing_template_id')->nullable();
$table->unsignedInteger('marketing_event_id')->nullable();
$table->timestamps();

$table->foreign('marketing_template_id')->references('id')->on('email_templates')->onDelete('set null');
$table->foreign('marketing_event_id')->references('id')->on('marketing_events')->onDelete('set null');
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('marketing_campaigns');
Expand Down
2 changes: 2 additions & 0 deletions packages/Webkul/Marketing/src/Models/Campaign.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

class Campaign extends Model implements CampaignContract
{
protected $table = 'marketing_campaigns';

/**
* The attributes that are fillable.
*
Expand Down
7 changes: 7 additions & 0 deletions packages/Webkul/Marketing/src/Models/CampaignProxy.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace Webkul\Marketing\Models;

use Konekt\Concord\Proxies\ModelProxy;

class CampaignProxy extends ModelProxy {}

0 comments on commit dd467c9

Please sign in to comment.