Skip to content

Commit

Permalink
Merge pull request #3 from neelkanthk/development
Browse files Browse the repository at this point in the history
Update in Readme
  • Loading branch information
neelkanthk authored Oct 21, 2020
2 parents 0f36ea8 + 650741f commit 593aa32
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ composer require neelkanthk/laravel-schedulable

#### 1. Create a migration to add ```schedule_at``` column in any table using package's ```scheduleAt();``` method which creates a column with name ```schedule_at```.

#### *NOTE:* If you want to use any other column name then simply use the ```$table->timestamp('column_name');``` method.
#### *NOTE:* If you want to use any other column name then simply use the ```$table->timestamp('column_name');``` method as shown below in examples.

```php
use Illuminate\Database\Migrations\Migration;
Expand All @@ -52,7 +52,7 @@ class AddScheduleAtColumnInPosts extends Migration
Schema::table('posts', function (Blueprint $table) {
$table->scheduleAt(); //Using default schedule_at column
//or
$table->timestamp('scheduled_on', 0); //Using custom column name
$table->timestamp('publish_at', 0); //Using custom column name
});
}

Expand All @@ -66,7 +66,7 @@ class AddScheduleAtColumnInPosts extends Migration
Schema::table('posts', function (Blueprint $table) {
$table->dropColumn('schedule_at'); //Using default schedule_at column
//or
$table->dropColumn('scheduled_on'); //Using custom column name
$table->dropColumn('publish_at'); //Using custom column name
});
}
}
Expand All @@ -84,7 +84,7 @@ class Post extends Model
{
use Schedulable;

const SCHEDULE_AT = "scheduled_on"; //Specify the custom column name
const SCHEDULE_AT = "publish_at"; //Specify the custom column name
}
```

Expand Down

0 comments on commit 593aa32

Please sign in to comment.