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 today

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

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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

1668d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4512646?v=4)[Kieran Marshall](/maintainers/kayrunm)[@kayrunm](https://github.com/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

[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[mehrancodes/laravel-harbor

A CLI tool to Quickly create On-Demand preview environment for your apps.

10097.5k](/packages/mehrancodes-laravel-harbor)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5021.9k](/packages/simplestats-io-laravel-client)[aedart/athenaeum

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

245.2k](/packages/aedart-athenaeum)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1235.9k20](/packages/fleetbase-core-api)

PHPackages © 2026

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