Download the PHP package darkghosthunter/laradate without Composer

On this page you can find all versions of the php package darkghosthunter/laradate. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laradate

Aron Visuals - Unsplash (UL) #BXOXnQ26B7o

Latest Stable Version License Coverage Status Laravel Octane Compatible Laravel Jetstream Compatible

Laradate

Parse a date from the URL, receive it as a Carbon instance in your controller.

Requirements

For older versions support, consider helping by sponsoring or donating.

Installation

You can install the package via composer:

Usage

Simply set the date parameter to any route. In your controller, you will get a Carbon instance if the name of the variable is $date.

A date must be formatted as YYYY-MM-DD to reach the route, otherwise it won't be found.

Behind the scenes, Laradate will use the DateFactory, which is the default factory in your application, to create instances of DateTimeInterface. By default, your application uses the Carbon library.

If the datetime cannot be parsed, the route will return HTTP 404.

Using formats

You can also use custom formatting for your routes with {date:format}. The format follows the same Datetime formats. If the string doesn't follow the format, the route will return an HTTP 404.

Because of limitations of Laravel Router parameters for bindings, use underscore _ as separator while using formats.

Date between middleware

To avoid having to fallback to the Laravel Validator inside the controller, you can use the date middleware which accepts a minimum, maximum, or both, dates to compare (inclusive). If the date is not inside the dates, an HTTP 404 code will be returned.

Since the dates are passed to DateTime, you can use words like today 00:00 or 3 months 23:59:59 for relative dates.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

License

The MIT License (MIT). Please see License File for more information.


All versions of laradate with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
ext-json Version *
illuminate/support Version ^8.0
illuminate/routing Version ^8.0
illuminate/http Version ^8.0
nesbot/carbon Version >=2.51.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package darkghosthunter/laradate contains the following files

Loading the files please wait ....