PHPackages                             kayrunm/php-adventofcode - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. kayrunm/php-adventofcode

ActiveProject[Utility &amp; Helpers](/categories/utility)

kayrunm/php-adventofcode
========================

A PHP solution wrapper for Advent of Code.

1.0(4y ago)03MITPHPPHP ^8.1

Since Dec 7Pushed 4y ago1 watchersCompare

[ Source](https://github.com/kayrunm/adventofcode-wrapper)[ Packagist](https://packagist.org/packages/kayrunm/php-adventofcode)[ RSS](/packages/kayrunm-php-adventofcode/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (5)Versions (2)Used By (0)

Advent of Code wrapper
======================

[](#advent-of-code-wrapper)

This is an Advent of Code solution wrapper built on Laravel Zero.

Getting Started
---------------

[](#getting-started)

### Valid years

[](#valid-years)

You can change which years are valid challenge years by changing the `LOWEST_YEAR` and `CURRENT_YEAR` environment variables. The `CURRENT_YEAR` is used as a fallback for any commands that are run without a given year.

### API session

[](#api-session)

You will need to grab your `session` ID from the Advent of Code website. This is used for downloading your unique input for each day's challenge.

You can do this by logging into the [Advent of Code](https://adventofcode.com) website and then copying the string stored in the cookie called `session`. Once you've got that copied, paste it in your `.env` file under the `AOC_SESSION` key.

Commands
--------

[](#commands)

### Make Solution

[](#make-solution)

The `adventofcode make {day}` command creates a solution file and downloads your unique input for the specified day's challenge. By default, it will retrieve challenges from the year you specified in your `CURRENT_YEAR` environment variable. This can be set at runtime with the `--year` option.

For example, the following will create a solution for the 7th day in 2021:

```
$ php adventofcode make 7 --year=2021
```

### Solutions

[](#solutions)

You can run the solutions for a given day or year with the `day` or `year` commands.

For example, the following will run the solution for the 7th day in 2021:

```
$ php adventofcode day 7 --year=2021
```

And the following will run all the available solutions for 2021.

```
$ php adventofcode year 2021

```

Refactoring
-----------

[](#refactoring)

To aid with refactoring, you can set the answers for any solution by setting the `$answers`property on any of your Solution classes.

Let's say the answers for part A and part B of a solution are `383` and `493`, you can set them with the following code:

```
protected array $answers = [
    'partOne' => 383,
    'partTwo' => 493,
];
```

By doing this, running any of your solution commands will display whether your solution has the correct answer or not.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1623d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6943d16d8939d4ce7d5f4d4df1fbb6b12d5d2834bacb07dd2efb82b7ca278377?d=identicon)[kayrunm](/maintainers/kayrunm)

---

Top Contributors

[![kayrunm](https://avatars.githubusercontent.com/u/4512646?v=4)](https://github.com/kayrunm "kayrunm (8 commits)")

---

Tags

laravel-zeroaocadvent of code

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/kayrunm-php-adventofcode/health.svg)

```
[![Health](https://phpackages.com/badges/kayrunm-php-adventofcode/health.svg)](https://phpackages.com/packages/kayrunm-php-adventofcode)
```

###  Alternatives

[ashallendesign/favicon-fetcher

A Laravel package for fetching website's favicons.

190272.4k3](/packages/ashallendesign-favicon-fetcher)[glhd/conveyor-belt

14797.0k](/packages/glhd-conveyor-belt)[spatie/laravel-rdap

Perform RDAP queries in a Laravel app

72108.3k2](/packages/spatie-laravel-rdap)[crescat-io/saloon-sdk-generator

Simplified SDK Scaffolding for Saloon

13130.9k7](/packages/crescat-io-saloon-sdk-generator)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[ankurk91/laravel-ses-webhooks

Handle AWS SES webhooks in Laravel php framework

2534.2k](/packages/ankurk91-laravel-ses-webhooks)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
