PHP code example of todstoychev / calendar-events
1. Go to this page and download the library: Download todstoychev/calendar-events 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/ */
todstoychev / calendar-events example snippets
artisan vendor:publish
artisan migrate
protected $calendarEventsService;
public function __construct(CalendarEventsService $calendarEventsService)
{
$this->calendarEventsService = $calendarEventsService;
}
namespace App\Http\Controllers;
use Todstoychev\CalendarEvents\Http\Requests\CalendarEventRequest;
use Todstoychev\CalendarEvents\Services\CalendarEventsService;
class IndexController extends Controller
{
protected $calendarEventsService;
public function __construct(CalendarEventsService $calendarEventsService)
{
$this->calendarEventsService = $calendarEventsService;
}
public function postAdd(CalendarEventRequest $request)
{
$this->calendarEventsService->createCalendarEvent($request->input());
}
}
public function getJson()
{
echo $this->calendarEventsService->getAllEventsAsJson();
}
config/app.php