• Stars
    star
    1,340
  • Rank 33,687 (Top 0.7 %)
  • Language
    PHP
  • License
    MIT License
  • Created over 7 years ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Query and format a set of opening hours

A helper to query and format a set of opening hours

Latest Version on Packagist Software License Tests Coverage Quality Score StyleCI Total Downloads

With spatie/opening-hours you create an object that describes a business' opening hours, which you can query for open or closed on days or specific dates, or use to present the times per day.

spatie/opening-hours can be used directly on Carbon thanks to cmixin/business-time so you can benefit opening hours features directly on your enhanced date objects.

A set of opening hours is created by passing in a regular schedule, and a list of exceptions.

// Add the use at the top of each file where you want to use the OpeningHours class:
use Spatie\OpeningHours\OpeningHours;

$openingHours = OpeningHours::create([
    'monday'     => ['09:00-12:00', '13:00-18:00'],
    'tuesday'    => ['09:00-12:00', '13:00-18:00'],
    'wednesday'  => ['09:00-12:00'],
    'thursday'   => ['09:00-12:00', '13:00-18:00'],
    'friday'     => ['09:00-12:00', '13:00-20:00'],
    'saturday'   => ['09:00-12:00', '13:00-16:00'],
    'sunday'     => [],
    'exceptions' => [
        '2016-11-11' => ['09:00-12:00'],
        '2016-12-25' => [],
        '01-01'      => [],                // Recurring on each 1st of January
        '12-25'      => ['09:00-12:00'],   // Recurring on each 25th of December
    ],
]);

// This will allow you to display things like:

$now = new DateTime('now');
$range = $openingHours->currentOpenRange($now);

if ($range) {
    echo "It's open since ".$range->start()."\n";
    echo "It will close at ".$range->end()."\n";
} else {
    echo "It's closed since ".$openingHours->previousClose($now)->format('l H:i')."\n";
    echo "It will re-open at ".$openingHours->nextOpen($now)->format('l H:i')."\n";
}

The object can be queried for a day in the week, which will return a result based on the regular schedule:

// Open on Mondays:
$openingHours->isOpenOn('monday'); // true

// Closed on Sundays:
$openingHours->isOpenOn('sunday'); // false

It can also be queried for a specific date and time:

// Closed because it's after hours:
$openingHours->isOpenAt(new DateTime('2016-09-26 19:00:00')); // false

// Closed because Christmas was set as an exception
$openingHours->isOpenOn('2016-12-25'); // false

It can also return arrays of opening hours for a week or a day:

// OpeningHoursForDay object for the regular schedule
$openingHours->forDay('monday');

// OpeningHoursForDay[] for the regular schedule, keyed by day name
$openingHours->forWeek();

// Array of day with same schedule for the regular schedule, keyed by day name, days combined by working hours
$openingHours->forWeekCombined();

// OpeningHoursForDay object for a specific day
$openingHours->forDate(new DateTime('2016-12-25'));

// OpeningHoursForDay[] of all exceptions, keyed by date
$openingHours->exceptions();

On construction you can set a flag for overflowing times across days. For example, for a night club opens until 3am on Friday and Saturday:

$openingHours = \Spatie\OpeningHours\OpeningHours::create([
    'overflow' => true,
    'friday'   => ['20:00-03:00'],
    'saturday' => ['20:00-03:00'],
], null);

This allows the API to further at yesterdays data to check if the opening hours are open from yesterdays time range.

You can add data in definitions then retrieve them:

$openingHours = OpeningHours::create([
    'monday' => [
        'data' => 'Typical Monday',
        '09:00-12:00',
        '13:00-18:00',
    ],
    'tuesday' => [
        '09:00-12:00',
        '13:00-18:00',
        [
            '19:00-21:00',
            'data' => 'Extra on Tuesday evening',
        ],
    ],
    'exceptions' => [
        '2016-12-25' => [
            'data' => 'Closed for Christmas',
        ],
    ],
]);

echo $openingHours->forDay('monday')->getData(); // Typical Monday
echo $openingHours->forDate(new DateTime('2016-12-25'))->getData(); // Closed for Christmas
echo $openingHours->forDay('tuesday')[2]->getData(); // Extra on Tuesday evening

In the example above, data are strings but it can be any kind of value. So you can embed multiple properties in an array.

For structure convenience, the data-hours couple can be a fully-associative array, so the example above is strictly equivalent to the following:

$openingHours = OpeningHours::create([
    'monday' => [
        'hours' => [
            '09:00-12:00',
            '13:00-18:00',
        ],
        'data' => 'Typical Monday',
    ],
    'tuesday' => [
        ['hours' => '09:00-12:00'],
        ['hours' => '13:00-18:00'],
        ['hours' => '19:00-21:00', 'data' => 'Extra on Tuesday evening'],
    ],
    // Open by night from Wednesday 22h to Thursday 7h:
    'wednesday' => ['22:00-24:00'], // use the special "24:00" to reach midnight included
    'thursday' => ['00:00-07:00'],
    'exceptions' => [
        '2016-12-25' => [
            'hours' => [],
            'data'  => 'Closed for Christmas',
        ],
    ],
]);

The last structure tool is the filter, it allows you to pass closures (or callable function/method reference) that take a date as a parameter and returns the settings for the given date.

$openingHours = OpeningHours::create([
    'monday' => [
       '09:00-12:00',
    ],
    'filters' => [
        function ($date) {
            $year         = intval($date->format('Y'));
            $easterMonday = new DateTimeImmutable('2018-03-21 +'.(easter_days($year) + 1).'days');
            if ($date->format('m-d') === $easterMonday->format('m-d')) {
                return []; // Closed on Easter Monday
                // Any valid exception-array can be returned here (range of hours, with or without data)
            }
            // Else the filter does not apply to the given date
        },
    ],
]);

If a callable is found in the "exceptions" property, it will be added automatically to filters so you can mix filters and exceptions both in the exceptions array. The first filter that returns a non-null value will have precedence over the next filters and the filters array has precedence over the filters inside the exceptions array.

Warning: We will loop on all filters for each date from which we need to retrieve opening hours and can neither predicate nor cache the result (can be a random function) so you must be careful with filters, too many filters or long process inside filters can have a significant impact on the performance.

It can also return the next open or close DateTime from a given DateTime.

// The next open datetime is tomorrow morning, because we’re closed on 25th of December.
$nextOpen = $openingHours->nextOpen(new DateTime('2016-12-25 10:00:00')); // 2016-12-26 09:00:00

// The next open datetime is this afternoon, after the lunch break.
$nextOpen = $openingHours->nextOpen(new DateTime('2016-12-24 11:00:00')); // 2016-12-24 13:00:00


// The next close datetime is at noon.
$nextClose = $openingHours->nextClose(new DateTime('2016-12-24 10:00:00')); // 2016-12-24 12:00:00

// The next close datetime is tomorrow at noon, because we’re closed on 25th of December.
$nextClose = $openingHours->nextClose(new DateTime('2016-12-25 15:00:00')); // 2016-12-26 12:00:00

Read the usage section for the full api.

Spatie is a webdesign agency based in Antwerp, Belgium. You'll find an overview of all our open source projects on our website.

Support us

We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.

Installation

You can install the package via composer:

composer require spatie/opening-hours

Usage

The package should only be used through the OpeningHours class. There are also three value object classes used throughout, Time, which represents a single time, TimeRange, which represents a period with a start and an end, and openingHoursForDay, which represents a set of TimeRanges which can't overlap.

Spatie\OpeningHours\OpeningHours

OpeningHours::create(array $data, $timezone = null, $toutputTimezone = null): Spatie\OpeningHours\OpeningHours

Static factory method to fill the set of opening hours.

$openingHours = OpeningHours::create([
    'monday' => ['09:00-12:00', '13:00-18:00'],
    // ...
]);

If no timezone is specified, OpeningHours will just assume you always pass DateTime objects that have already the timezone matching your schedule.

If you pass a $timezone as a second argument or via the array-key 'timezone' (it can be either a DateTimeZone object or a string), then passed dates will be converted to this timezone at the beginning of each method, then if the method return a date object (such as nextOpen, nextClose, previousOpen, previousClose, currentOpenRangeStart or currentOpenRangeEnd), then it's converted back to original timezone before output so the object can reflect a moment in user local time while OpeningHours can stick in its own business timezone.

Alternatively you can also specify both input and output timezone (using second and third argument) or using an array:

$openingHours = OpeningHours::create([
    'monday' => ['09:00-12:00', '13:00-18:00'],
    'timezone' => [
        'input' => 'America/New_York',
        'output' => 'Europe/Oslo',
    ],
]);

OpeningHours::mergeOverlappingRanges(array $schedule) : array

For safety sake, creating OpeningHours object with overlapping ranges will throw an exception unless you pass explicitly 'overflow' => true, in the opening hours array definition. You can also explicitly merge them.

$ranges = [
  'monday' => ['08:00-11:00', '10:00-12:00'],
];
$mergedRanges = OpeningHours::mergeOverlappingRanges($ranges); // Monday becomes ['08:00-12:00']

OpeningHours::create($mergedRanges);
// Or use the following shortcut to create from ranges that possibly overlap:
OpeningHours::createAndMergeOverlappingRanges($ranges);

Not all days are mandatory, if a day is missing, it will be set as closed.

OpeningHours::fill(array $data): Spatie\OpeningHours\OpeningHours

The same as create, but non-static.

$openingHours = (new OpeningHours)->fill([
    'monday' => ['09:00-12:00', '13:00-18:00'],
    // ...
]);

OpeningHours::forWeek(): Spatie\OpeningHours\OpeningHoursForDay[]

Returns an array of OpeningHoursForDay objects for a regular week.

$openingHours->forWeek();

OpeningHours::forWeekCombined(): array

Returns an array of days. Array key is first day with same hours, array values are days that have the same working hours and OpeningHoursForDay object.

$openingHours->forWeekCombined();

OpeningHours::forWeekConsecutiveDays(): array

Returns an array of concatenated days, adjacent days with the same hours. Array key is first day with same hours, array values are days that have the same working hours and OpeningHoursForDay object.

Warning: consecutive days are considered from Monday to Sunday without looping (Monday is not consecutive to Sunday) no matter the days order in initial data.

$openingHours->forWeekConsecutiveDays();

OpeningHours::forDay(string $day): Spatie\OpeningHours\OpeningHoursForDay

Returns an OpeningHoursForDay object for a regular day. A day is lowercase string of the english day name.

$openingHours->forDay('monday');

OpeningHours::forDate(DateTimeInterface $dateTime): Spatie\OpeningHours\OpeningHoursForDay

Returns an OpeningHoursForDay object for a specific date. It looks for an exception on that day, and otherwise it returns the opening hours based on the regular schedule.

$openingHours->forDate(new DateTime('2016-12-25'));

OpeningHours::exceptions(): Spatie\OpeningHours\OpeningHoursForDay[]

Returns an array of all OpeningHoursForDay objects for exceptions, keyed by a Y-m-d date string.

$openingHours->exceptions();

OpeningHours::isOpenOn(string $day): bool

Checks if the business is open (contains at least 1 range of open hours) on a day in the regular schedule.

$openingHours->isOpenOn('saturday');

If the given string is a date, it will check if it's open (contains at least 1 range of open hours) considering both regular day schedule and possible exceptions.

$openingHours->isOpenOn('2020-09-03');
$openingHours->isOpenOn('09-03'); // If year is omitted, current year is used instead

OpeningHours::isClosedOn(string $day): bool

Checks if the business is closed on a day in the regular schedule.

$openingHours->isClosedOn('sunday');

OpeningHours::isOpenAt(DateTimeInterface $dateTime): bool

Checks if the business is open on a specific day, at a specific time.

$openingHours->isOpenAt(new DateTime('2016-26-09 20:00'));

OpeningHours::isClosedAt(DateTimeInterface $dateTime): bool

Checks if the business is closed on a specific day, at a specific time.

$openingHours->isClosedAt(new DateTime('2016-26-09 20:00'));

OpeningHours::isOpen(): bool

Checks if the business is open right now.

$openingHours->isOpen();

OpeningHours::isClosed(): bool

Checks if the business is closed right now.

$openingHours->isClosed();

OpeningHours::nextOpen

OpeningHours::nextOpen(
    ?DateTimeInterface $dateTime = null,
    ?DateTimeInterface $searchUntil = null,
    ?DateTimeInterface $cap = null,
) : DateTimeInterface`

Returns next open DateTime from the given DateTime ($dateTime or from now if this parameter is null or omitted).

If a DateTimeImmutable object is passed, a DateTimeImmutable object is returned.

Set $searchUntil to a date to throw an exception if no open time can be found before this moment.

Set $cap to a date so if no open time can be found before this moment, $cap is returned.

$openingHours->nextOpen(new DateTime('2016-12-24 11:00:00'));

`

OpeningHours::nextClose

OpeningHours::nextClose(
    ?DateTimeInterface $dateTime = null,
    ?DateTimeInterface $searchUntil = null,
    ?DateTimeInterface $cap = null,
) : DateTimeInterface`

Returns next close DateTime from the given DateTime ($dateTime or from now if this parameter is null or omitted).

If a DateTimeImmutable object is passed, a DateTimeImmutable object is returned.

Set $searchUntil to a date to throw an exception if no closed time can be found before this moment.

Set $cap to a date so if no closed time can be found before this moment, $cap is returned.

$openingHours->nextClose(new DateTime('2016-12-24 11:00:00'));

OpeningHours::previousOpen

OpeningHours::previousOpen(
    ?DateTimeInterface $dateTime = null,
    ?DateTimeInterface $searchUntil = null,
    ?DateTimeInterface $cap = null,
) : DateTimeInterface`

Returns previous open DateTime from the given DateTime ($dateTime or from now if this parameter is null or omitted).

If a DateTimeImmutable object is passed, a DateTimeImmutable object is returned.

Set $searchUntil to a date to throw an exception if no open time can be found after this moment.

Set $cap to a date so if no open time can be found after this moment, $cap is returned.

$openingHours->previousOpen(new DateTime('2016-12-24 11:00:00'));

OpeningHours::previousClose

OpeningHours::previousClose(
    ?DateTimeInterface $dateTime = null,
    ?DateTimeInterface $searchUntil = null,
    ?DateTimeInterface $cap = null,
) : DateTimeInterface`

Returns previous close DateTime from the given DateTime ($dateTime or from now if this parameter is null or omitted).

If a DateTimeImmutable object is passed, a DateTimeImmutable object is returned.

Set $searchUntil to a date to throw an exception if no closed time can be found after this moment.

Set $cap to a date so if no closed time can be found after this moment, $cap is returned.

$openingHours->nextClose(new DateTime('2016-12-24 11:00:00'));

OpeningHours::diffInOpenHours(DateTimeInterface $startDate, DateTimeInterface $endDate) : float

Return the amount of open time (number of hours as a floating number) between 2 dates/times.

$openingHours->diffInOpenHours(new DateTime('2016-12-24 11:00:00'), new DateTime('2016-12-24 16:34:25'));

OpeningHours::diffInOpenMinutes(DateTimeInterface $startDate, DateTimeInterface $endDate) : float

Return the amount of open time (number of minutes as a floating number) between 2 dates/times.

OpeningHours::diffInOpenSeconds(DateTimeInterface $startDate, DateTimeInterface $endDate) : float

Return the amount of open time (number of seconds as a floating number) between 2 dates/times.

OpeningHours::diffInClosedHours(DateTimeInterface $startDate, DateTimeInterface $endDate) : float

Return the amount of closed time (number of hours as a floating number) between 2 dates/times.

$openingHours->diffInClosedHours(new DateTime('2016-12-24 11:00:00'), new DateTime('2016-12-24 16:34:25'));

OpeningHours::diffInClosedMinutes(DateTimeInterface $startDate, DateTimeInterface $endDate) : float

Return the amount of closed time (number of minutes as a floating number) between 2 dates/times.

OpeningHours::diffInClosedSeconds(DateTimeInterface $startDate, DateTimeInterface $endDate) : float

Return the amount of closed time (number of seconds as a floating number) between 2 dates/times.

OpeningHours::currentOpenRange(DateTimeInterface $dateTime) : false | TimeRange

Returns a Spatie\OpeningHours\TimeRange instance of the current open range if the business is open, false if the business is closed.

$range = $openingHours->currentOpenRange(new DateTime('2016-12-24 11:00:00'));

if ($range) {
    echo "It's open since ".$range->start()."\n";
    echo "It will close at ".$range->end()."\n";
} else {
    echo "It's closed";
}

OpeningHours::currentOpenRangeStart(DateTimeInterface $dateTime) : false | DateTime

Returns a DateTime instance of the date and time since when the business is open if the business is open, false if the business is closed.

Note: date can be the previous day if you use night ranges.

$date = $openingHours->currentOpenRangeStart(new DateTime('2016-12-24 11:00:00'));

if ($date) {
    echo "It's open since ".$date->format('H:i');
} else {
    echo "It's closed";
}

OpeningHours::currentOpenRangeEnd(DateTimeInterface $dateTime) : false | DateTime

Returns a DateTime instance of the date and time until when the business will be open if the business is open, false if the business is closed.

Note: date can be the next day if you use night ranges.

$date = $openingHours->currentOpenRangeEnd(new DateTime('2016-12-24 11:00:00'));

if ($date) {
    echo "It will close at ".$date->format('H:i');
} else {
    echo "It's closed";
}

OpeningHours::asStructuredData(strinf $format = 'H:i', string|DateTimeZone $timezone) : array

Returns a OpeningHoursSpecification as an array.

$openingHours->asStructuredData();
$openingHours->asStructuredData('H:i:s'); // Customize time format, could be 'h:i a', 'G:i', etc.
$openingHours->asStructuredData('H:iP', '-05:00'); // Add a timezone
// Timezone can be numeric or string like "America/Toronto" or a DateTimeZone instance
// But be careful, the time is arbitrary applied on 1970-01-01, so it does not handle daylight
// saving time, meaning Europe/Paris is always +01:00 even in summer time.

Spatie\OpeningHours\OpeningHoursForDay

This class is meant as read-only. It implements ArrayAccess, Countable and IteratorAggregate so you can process the list of TimeRanges in an array-like way.

Spatie\OpeningHours\TimeRange

Value object describing a period with a start and an end time. Can be cast to a string in a H:i-H:i format.

Spatie\OpeningHours\Time

Value object describing a single time. Can be cast to a string in a H:i format.

Adapters

OpenStreetMap

You can convert OpenStreetMap format to OpeningHours object using osm-opening-hours (thanks to mgrundkoetter)

Changelog

Please see CHANGELOG for more information about what has changed recently.

Testing

composer test

Contributing

Please see CONTRIBUTING for details.

Security

If you've found a bug regarding security please mail [email protected] instead of using the issue tracker.

Postcardware

You're free to use this package, but if it makes it to your production environment we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using.

Our address is: Spatie, Kruikstraat 22, 2018 Antwerp, Belgium.

We publish all received postcards on our company website.

Credits

License

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

More Repositories

1

laravel-permission

Associate users with roles and permissions
PHP
11,600
star
2

laravel-medialibrary

Associate files with Eloquent models
PHP
5,427
star
3

laravel-backup

A package to backup your Laravel app
PHP
5,337
star
4

laravel-activitylog

Log activity inside your Laravel app
PHP
5,128
star
5

browsershot

Convert HTML to an image, PDF or string
PHP
4,434
star
6

laravel-query-builder

Easily build Eloquent queries from API requests
PHP
3,675
star
7

laravel-analytics

A Laravel package to retrieve pageviews and other data from Google Analytics
PHP
2,948
star
8

image-optimizer

Easily optimize images using PHP
PHP
2,450
star
9

async

Easily run code asynchronously
PHP
2,401
star
10

crawler

An easy to use, powerful crawler implemented in PHP. Can execute Javascript.
PHP
2,400
star
11

laravel-responsecache

Speed up a Laravel app by caching the entire response
PHP
2,248
star
12

data-transfer-object

Data transfer objects with batteries included
PHP
2,220
star
13

laravel-translatable

Making Eloquent models translatable
PHP
2,030
star
14

laravel-sitemap

Create and generate sitemaps with ease
PHP
2,011
star
15

dashboard.spatie.be

The source code of dashboard.spatie.be
PHP
1,940
star
16

laravel-fractal

An easy to use Fractal wrapper built for Laravel and Lumen applications
PHP
1,845
star
17

package-skeleton-laravel

A skeleton repository for Spatie's Laravel Packages
PHP
1,714
star
18

laravel-collection-macros

A set of useful Laravel collection macros
PHP
1,602
star
19

laravel-newsletter

Manage Mailcoach and MailChimp newsletters in Laravel
PHP
1,570
star
20

period

Complex period comparisons
PHP
1,515
star
21

checklist-going-live

The checklist that is used when a project is going live
1,489
star
22

laravel-tags

Add tags and taggable behaviour to your Laravel app
PHP
1,454
star
23

schema-org

A fluent builder Schema.org types and ld+json generator
PHP
1,284
star
24

eloquent-sortable

Sortable behaviour for Eloquent models
PHP
1,268
star
25

laravel-cookie-consent

Make your Laravel app comply with the crazy EU cookie law
PHP
1,268
star
26

laravel-sluggable

An opinionated package to create slugs for Eloquent models
PHP
1,236
star
27

laravel-searchable

Pragmatically search through models and other sources
PHP
1,217
star
28

pdf-to-image

Convert a pdf to an image
PHP
1,207
star
29

once

A magic memoization function
PHP
1,159
star
30

laravel-honeypot

Preventing spam submitted through forms
PHP
1,134
star
31

laravel-mail-preview

A mail driver to quickly preview mail
PHP
1,134
star
32

laravel-image-optimizer

Optimize images in your Laravel app
PHP
1,121
star
33

laravel-google-calendar

Manage events on a Google Calendar
PHP
1,119
star
34

laravel-settings

Store strongly typed application settings
PHP
1,100
star
35

regex

A sane interface for php's built in preg_* functions
PHP
1,097
star
36

laravel-data

Powerful data objects for Laravel
PHP
1,073
star
37

image

Manipulate images with an expressive API
PHP
1,064
star
38

array-to-xml

A simple class to convert an array to xml
PHP
1,056
star
39

laravel-multitenancy

Make your Laravel app usable by multiple tenants
PHP
1,020
star
40

laravel-uptime-monitor

A powerful and easy to configure uptime and ssl monitor
PHP
997
star
41

db-dumper

Dump the contents of a database
PHP
987
star
42

laravel-model-states

State support for models
PHP
968
star
43

laravel-view-models

View models in Laravel
PHP
963
star
44

simple-excel

Read and write simple Excel and CSV files
PHP
930
star
45

laravel-web-tinker

Tinker in your browser
JavaScript
925
star
46

laravel-webhook-client

Receive webhooks in Laravel apps
PHP
908
star
47

laravel-db-snapshots

Quickly dump and load databases
PHP
889
star
48

laravel-mix-purgecss

Zero-config Purgecss for Laravel Mix
JavaScript
887
star
49

laravel-schemaless-attributes

Add schemaless attributes to Eloquent models
PHP
880
star
50

blender

The Laravel template used for our CMS like projects
PHP
879
star
51

calendar-links

Generate add to calendar links for Google, iCal and other calendar systems
PHP
877
star
52

laravel-webhook-server

Send webhooks from Laravel apps
PHP
870
star
53

laravel-menu

Html menu generator for Laravel
PHP
854
star
54

phpunit-watcher

A tool to automatically rerun PHPUnit tests when source code changes
PHP
831
star
55

laravel-failed-job-monitor

Get notified when a queued job fails
PHP
826
star
56

laravel-model-status

Easily add statuses to your models
PHP
818
star
57

laravel-schedule-monitor

Monitor scheduled tasks in a Laravel app
PHP
800
star
58

form-backend-validation

An easy way to validate forms using back end logic
JavaScript
800
star
59

temporary-directory

A simple class to work with a temporary directory
PHP
796
star
60

laravel-feed

Easily generate RSS feeds
PHP
789
star
61

laravel-server-monitor

Don't let your servers just melt down
PHP
769
star
62

fork

A lightweight solution for running code concurrently in PHP
PHP
751
star
63

enum

Strongly typed enums in PHP supporting autocompletion and refactoring
PHP
737
star
64

laravel-tail

An artisan command to tail your application logs
PHP
726
star
65

valuestore

Easily store some values
PHP
722
star
66

laravel-package-tools

Tools for creating Laravel packages
PHP
722
star
67

laravel-event-sourcing

The easiest way to get started with event sourcing in Laravel
PHP
716
star
68

geocoder

Geocode addresses to coordinates
PHP
709
star
69

pdf-to-text

Extract text from a pdf
PHP
707
star
70

ssh

A lightweight package to execute commands over an SSH connection
PHP
696
star
71

menu

Html menu generator
PHP
688
star
72

laravel-url-signer

Create and validate signed URLs with a limited lifetime
PHP
685
star
73

ssl-certificate

A class to validate SSL certificates
PHP
675
star
74

laravel-route-attributes

Use PHP 8 attributes to register routes in a Laravel app
PHP
674
star
75

laravel-validation-rules

A set of useful Laravel validation rules
PHP
663
star
76

url

Parse, build and manipulate URL's
PHP
659
star
77

laravel-html

Painless html generation
PHP
654
star
78

laravel-health

Check the health of your Laravel app
PHP
648
star
79

laravel-event-projector

Event sourcing for Artisans πŸ“½
PHP
642
star
80

laravel-server-side-rendering

Server side rendering JavaScript in your Laravel application
PHP
636
star
81

vue-tabs-component

An easy way to display tabs with Vue
JavaScript
626
star
82

macroable

A trait to dynamically add methods to a class
PHP
621
star
83

laravel-csp

Set content security policy headers in a Laravel app
PHP
614
star
84

laravel-blade-javascript

A Blade directive to export variables to JavaScript
PHP
608
star
85

laravel-cors

Send CORS headers in a Laravel application
PHP
607
star
86

laravel-translation-loader

Store your translations in the database or other sources
PHP
602
star
87

vue-table-component

A straight to the point Vue component to display tables
JavaScript
591
star
88

activitylog

A very simple activity logger to monitor the users of your website or application
PHP
586
star
89

http-status-check

CLI tool to crawl a website and check HTTP status codes
PHP
584
star
90

phpunit-snapshot-assertions

A way to test without writing actual testΒ cases
PHP
584
star
91

laravel-queueable-action

Queueable actions in Laravel
PHP
584
star
92

laravel-short-schedule

Schedule artisan commands to run at a sub-minute frequency
PHP
579
star
93

laravel-onboard

A Laravel package to help track user onboarding steps
PHP
579
star
94

freek.dev

The sourcecode of freek.dev
PHP
571
star
95

server-side-rendering

Server side rendering JavaScript in a PHP application
PHP
568
star
96

laravel-pdf

Create PDF files in Laravel apps
PHP
563
star
97

string

String handling evolved
PHP
558
star
98

ray

Debug with Ray to fix problems faster
PHP
540
star
99

laravel-http-logger

Log HTTP requests in Laravel applications
PHP
538
star
100

laravel-blade-x

Use custom HTML components in your Blade views
PHP
533
star