1. Go to this page and download the library: Download bhavin-thummar/month-picker 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/ */
bhavin-thummar / month-picker example snippets
use BhavinThummar\MonthPicker\MonthPicker;
public function fields(Request $request)
{
return [
//for index page
MonthPicker::make('Month & Year', 'month_year', function () {
if ($this->month_year) {
return array('month' => date('m', strtotime(($this->month_year))), 'year' => date('Y', strtotime(($this->month_year))));
}
})
->onlyOnForms(),
//for detail and view page
MonthPicker::make('Month & Year', 'month_year', function () {
return date('M-Y', strtotime($this->month_year));
})->sortable()->exceptOnForms(),
];
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.