🚀 DevOps & SRE Certification Program 📅 Starting: 1st of Every Month 🤝 +91 8409492687 🔍 Contact@DevOpsSchool.com

Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

HOW TO CREATE EVENT CALENDAR IN LARAVEL? PART-2

Step 1.Create a Laravel Project

Firstly, Create a new project in laravel, so we open Git Bash,  Go to My Computer/This PC–>LocalDisk(C:)–>Xampp–>Htdocs (Press right click on Mouse)

$ composer create-project --prefer-dist laravel/laravel Event_Calendar "5.8.*"
view raw new hosted with ❤ by GitHub
We write down the following command on Git Bash.

Step 2. Now we move to the project directory on Git Bash, so write down the following command –>

Step 3. Install Composer Package

In this step, we have to download and install the Laravel-full calendar package for use to generate Event Calendar. So just run the following command to download and install the package.


$ composer require maddhatter/laravel-fullcalendar

Step 4. Open Project in Visual Studio

Step 5. Application Configuration

After successfully installed the package then we should update the application config details to use the package in our application. Here we need to add providers & aliases array details with the following details

'providers' => [
....
....
MaddHatter\LaravelFullcalendar\ServiceProvider::class,
],
'aliases' => [
....
....
'Calendar' => MaddHatter\LaravelFullcalendar\Facades\Calendar::class,
]
view raw config hosted with ❤ by GitHub

Step 5. Create Model, Controller, and Migration

Here, we need to create a Model, Controller, and Migration for Events using Laravel  composer artisan command, so first fire bellow command:

php artisan make:model Event -mc

Above command, help us to create Model, Controller, and Migration for Event master. 

Step 6.  In the migration table file.

We need to add the required no of columns details for the event table like title, color, start_date, and end_date, etc.

public function up()
{
Schema::create('events', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('title');
$table->string('color');
$table->date('start_date');
$table->date('end_date');
$table->timestamps();
});
}
view raw migration hosted with ❤ by GitHub

Step 7. We need to go and update the Event model file in our application like fillable, primary key, product, etc.

Event model files present at app/Event.php path and just update with following details in it.

class Event extends Model
{
protected $table="events";
protected $fillable=["title","color","start_date","end_date"];
}
view raw Event.php hosted with ❤ by GitHub

Step 8. Routes Definition

We want to add new routes for showing Event Calendar. So just go to routes/web.php file and update the following routes to access data table operation in our application.

Route::resource('/eventpage','EventController');
//Route::get('addeventurl','EventController@create')->name('EventController.store');
Route::get('addeventurl','EventController@display')->name('EventController.store');
Route::post('addeventurl/store','EventController@store')->name('addevent.store');
Route::get('editeventurl','EventController@show');
Route::get('deleteeventurl','EventController@show');
Route::post('editeventurl/update/{id}','EventController@update')->name('editform_update');
Route::get('deleteeventurl/{id}','EventController@destroy');

Step 9. Before migrate we Update database name  in .env file  (DB_DATABASE=eventcalendar)

Step 10. Open Xampp and start apache and Mysql and click admin to open phpMyAdmin database

In Part 3, we will see how to make a new controller for Event Calendar?

Click Here https://www.devopsschool.com/blog/how-to-create-event-calendar-in-laravel-part-3/

Certification Courses

DevOpsSchool has introduced a series of professional certification courses designed to enhance your skills and expertise in cutting-edge technologies and methodologies. Whether you are aiming to excel in development, security, or operations, these certifications provide a comprehensive learning experience. Explore the following programs:

DevOps Certification, SRE Certification, and DevSecOps Certification by DevOpsSchool

Explore our DevOps Certification, SRE Certification, and DevSecOps Certification programs at DevOpsSchool. Gain the expertise needed to excel in your career with hands-on training and globally recognized certifications.