PHP code example of contrainteractive / content-scheduler
1. Go to this page and download the library: Download contrainteractive/content-scheduler library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
contrainteractive / content-scheduler example snippets
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use ContraInteractive\ContentScheduler\Traits\Schedulable;
use ContraInteractive\ContentScheduler\Traits\HasScheduling;
class Post extends Model
{
use Schedulable;
use HasScheduling;
// ...
}
$model = AnyModel::find(1);
Scheduler::schedulePublish($model, '2027-01-23')
// Optionally, you can set the scheduled unpublish date
->scheduleUnpublish($model, '2028-01-25');