sindev/sinpick

Laravel helper for jQuery UI datepicker

dev-master 2019-10-09 08:49 UTC

This package is auto-updated.

Last update: 2024-04-09 18:49:58 UTC


README

This is a simple helper package to add jQuery ui datepicker in Laravel apps.

Installing

Require the package with composer using the following command :

composer require sindev/sinpick

Usage

You can use it in your routes like this :

Route::get('/', function () {
    $datepicker = \Larapick::Init();
    return view('welcome',compact('datepicker'));
});

and in your view you need to add the datepicker scripts

<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>{{ config('app.name', 'Laravel') }}</title>
    <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
    <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
</head>
<body>
    {!! $datepicker->datepicker() !!}
    {!! $datepicker->scripts() !!}
    <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
</body>
</html>

Screenshot

alt text