voidfire / calendar
This package is abandoned and no longer maintained.
No replacement package was suggested.
A Laravel Nova card.
1.0
2020-03-04 15:02 UTC
Requires
- php: >=7.1.0
This package is auto-updated.
Last update: 2020-05-22 16:09:59 UTC
README
A complete Laravel Nova Ant Vue Calendar Card Ready to work out of the box
Getting Started
Requirements
QuickStart
composer require voidfire/calendar
php artisan vendor:publish --tag=events-manager-migrations --force
php artisan migrate
To setup the card, you must register the card with Nova. This is typically done in the cards
method of the NovaServiceProvider
.
// in app/Providers/NovaServiceProvider.php public function cards() { return [ // ... new \Voidfire\Calendar\Calendar, ]; }
The package will create for you the needed entities for the calendar Events
create_events_table.php
migration file:
public function up()
{
Schema::create('events', function (Blueprint $table) {
$table->increments('id');
$table->text('title');
$table->dateTime('start_date')->nullable();
$table->dateTime('end_date')->nullable();
$table->timestamps();
});
}
App\Nova\Event.php
resource:
public function fields(Request $request)
{
return [
ID::make()->sortable(),
Text::make('Title')->rules('required'),
DateTime::make('From', 'start_date'),
DateTime::make('To', 'end_date'),
];
}
App\Event.php
model:
class Event extends Model
{
protected $dates = [
'start_date',
'end_date',
];
}