Download the PHP package neelkanthk/laravel-schedulable without Composer

On this page you can find all versions of the php package neelkanthk/laravel-schedulable. 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 laravel-schedulable

Laravel Schedulable Logo

Laravel Schedulable Twitter

Schedule and Unschedule any eloquent model elegantly without cron job.

Salient Features:

  1. Turn any Eloquent Model into a schedulable one by using trait in the model.

  2. Schedule Models to a time in future and they will be returned in query results at specified date and time.

  3. Reschedule and Unschedule at any time using simple methods.

  4. Hook into the model's life cycle via custom model events provided by the package.

  5. Override the default column name and use your own custom column name.

Some example use cases when this package can be useful:

  1. A Blog type application which allows bloggers to schedule their post to go public on a future date and time.

  2. An E-commerce website where the items in the inventory can be added at any time from the admin panel but they can be scheduled to be made available to the customers at a particular date and time.

Minimum Requirements

  1. Laravel 6.0
  2. PHP 7.2

Installation

Usage

1. Create a migration to add column in any table using package's method which creates a column with name .

NOTE: If you want to use any other column name then simply use the method as shown below in examples.

2. Use the trait in any Model.

NOTE: If you have used a custom column name in the migration then you have to specify that column in the Model as shown below.

Usage

1. Scheduling a model

2. Unscheduling a model

3. Events and Observers

The package provides four model events and Observer methods which the developers can use to hook in the model's lifecycle.

The method fires two events namely before saving the model and after saving the model.

The method fires two events namely before saving the model and after saving the model.

The above events can be caught in the Observer class as follows:

4. Fetching data using queries

We will assume below posts table as reference to the following examples:

id title created_at updated_at schedule_at
1 Toy Story 1 2020-06-01 12:15:00 NULL NULL
2 Toy Story 2 2020-08-02 16:10:12 NULL 2020-08-10 10:10:00
3 Toy Story 3 2020-10-10 10:00:10 NULL 2021-12-20 00:00:00
4 Terminator 2 2020-10-11 00:00:00 NULL 2021-11-12 15:10:17

For the following examples, Suppose the current timestamp is 2020-10-18 00:00:00.

1. Default

By default all those models are fetched in which the column is having value or a timestamp less than or equal to the current timestamp.

So a eloquent query

will return Toy Story 1 and Toy Story 2

2. Retrieving scheduled models in addition to the normal.

To retrieve scheduled models in addition to the normal models, use the method.

The above query will return all the four rows in the above table.

3. Retrieving only scheduled models without normal.

To retrieve only scheduled models use the method.

The above query will return Toy Story 3 and Terminator 2.

4. Do not apply any functionality provided by .

In some cases you may not want to apply the trait at all. In those cases use the method in your query.

A general use case example.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Security

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

Credits

License

MIT


All versions of laravel-schedulable with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
laravel/framework Version >=6.0
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 neelkanthk/laravel-schedulable contains the following files

Loading the files please wait ....