c11k/starter-kit

The skeleton application for the Laravel framework, opinionated by the C11K team.

Installs: 3

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Forks: 0

Type:project

1.0.2 2025-06-12 18:33 UTC

This package is auto-updated.

Last update: 2025-06-13 15:19:10 UTC


README

This is an opinionated starter kit for a Laravel Project.

Installation

In your shell, substituting awesome-app for your app name:

laravel new awesome-app --using=c11k/starter-kit

Extra Composer Packages

This adds the extra composer packages that we all love and enjoy, including

Required Packages

  • Laravel Money because money should be handled correctly.
  • Laravel Horizon
  • Laravel Telescope
  • Laravel Reverb
  • Laravel Auditing to answer the question "Who changed this model and when?
  • Laravel Phone because why write your own phone number formatting when it's already been done?
  • Laravel Permission
  • Sqids because having a raw ID in your url is too 2010.

Development Packages

New Methods

This package adds a few new methods to the global space. These are located in app/helpers.local.php.

unparse_url()

function unparse_url(array | false $parsed_url): string

This is the opposite to, and complementary to parse_url(). It takes an array from parse_url() and returns an Url.

$url = 'https://gitlab.com/c11k/starter-kit';
$parts = parse_url($url);

// change the query because of some reason
$parts['query'] = 'search=start';

$newUrl = unparse_url($parts);

// "https://gitlab.com/c11k/starter-kit?search=start"

normalize_url()

function normalize_url(string $url = ''): string

This can be used when a user has provided an Url. It will parse the url, remove parts that don't belong, and unparse the url, returning a string.

normalize_url('https://gitlab.com/c11k/starter-kit?search=start')
// https://gitlab.com/c11k/starter-kit?search=start

normalize_url(' https://gitlab.com/c11k/starter-kit?search=start ')
// https://gitlab.com/c11k/starter-kit?search=start

wrap_string()

function wrap_string(string $string, string $cap = ''): string`

This will wrap a string in a string.

> wrap_string('hello world');
// "`hello world`"

wrap_string('hello world', '!');
// "!hello world!"

wrap_string('hello world', '~~');
// "~~hello world~~"

immutable()

function immutable(): CarbonImmutable

Like now(), but returns a new DateTimeImmutable object.

> immutable()
// Carbon\CarbonImmutable @1749762362 {#5761
//   date: 2025-06-12 21:06:02.350449 UTC (+00:00),
// }

array_cleave

function array_cleave(array $array): array

"Cleave" is a contronym; it has two definitions that are opposites of each other. In this case, it means to separate, like a cleaver. Given an array, it returns the keys and values as separate arrays.

$array = ['A' => 65, 'B' => 66, 'a' => 97, 'b' => 98];
[$keys, $values] = array_cleave($array);

// $keys: ['A', 'B', 'a', 'b']
// $values: [65, 66, 97, 98]

array_combine(...array_cleave(['A' => 65, 'B' => 66, 'a' => 97, 'b' => 98]));
// ['A' => 65, 'B' => 66, 'a' => 97, 'b' => 98]

Testing methods

These methods should only be used during testing, and if your specific use case requires.

fake_email()

function fake_email(): string

When seeding too many User accounts, the uniqueness of Faker overflows. This just adds a random string to each email for more randomess.

fake_email();
// inc9ns.crystel.buckridge@example.org

fake_phone_number()

function fake_phone_number(): string

Faker can generate phone numbers that do not validate with Laravel Phone. This simply forces a phone number that will validate against Laravel Phone. They will always be in the (704) area code in US because I only wanted to add one. Pull requests are welcome.

fake_phone_number();
// "+17044459994"