You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, the CalendarController expects a CalendarDataProviderInterface which is supplied through dependency injection.
For that to work, users of this package need to manually bind their own calendar data provider to the CalendarDataProviderInterface class in the boot() method of their NovaServiceProvider:
use App\Providers\CalendarDataProvider;
public function register()
{
$this->app->bind(CalendarDataProviderInterface::class, function($app) {
return new CalendarDataProvider();
});
}
It would be nice if instead, the calendar data provider could be supplied through the tool's constructor within the tools() method, like this:
use App\Providers\CalendarDataProvider;
public function tools()
{
return [
new NovaCalendar(new CalendarDataProvider),
];
}
That would open the door to having multiple instances of the calendar Tool, each with their own data provider. It would have the added benefit of making the installation of the package slightly simpler.
Any questions or doubts?
Add a comment to this issue and we'll talk about it.
The text was updated successfully, but these errors were encountered:
This is something I would definitely use as it'd allow me to separate certain types of events into their own calendar as currently some days can get very "cluttered" when there's a ton of stuff going on.
I've been playing with this and have to choose from several approaches. Will probably be released in version 2.0 together with PHP7 support because I don't think I can do this without introducing breaking changes.
Right now, the
CalendarController
expects aCalendarDataProviderInterface
which is supplied through dependency injection.For that to work, users of this package need to manually bind their own calendar data provider to the
CalendarDataProviderInterface
class in theboot()
method of theirNovaServiceProvider
:It would be nice if instead, the calendar data provider could be supplied through the tool's constructor within the
tools()
method, like this:That would open the door to having multiple instances of the calendar Tool, each with their own data provider. It would have the added benefit of making the installation of the package slightly simpler.
Any questions or doubts?
Add a comment to this issue and we'll talk about it.
The text was updated successfully, but these errors were encountered: