c11k/starter-kit
最新稳定版本:2.0.0
Composer 安装命令:
composer create-project c11k/starter-kit
包简介
The skeleton application for the Laravel framework, opinionated by the C11K team.
关键字:
README 文档
README
This is an opinionated starter kit for a Laravel Project.
[TOC]
Installation
In your shell, substituting awesome-app for your app name:
laravel new awesome-app --using=c11k/starter-kit
Admin Seeder
>>> [!caution] Remember to change the sample email and password if seeding yourself as an admin user in production. >>>
In the .env.example file, there are some SEEDER_SUPER_ADMIN_* environment
variables. These variables are used in the DefaultAdminSeeder class to seed
your default user. This is called when you seed the database using
php artisan db:seed or when seeding after a migration. Make sure to keep this
class updated when you add some non-optional User attributes, and feel free to
add extra attributes, or give the user Roles and/or Permissions.
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
- Laravel Debug Bar
- Laravel IDE Helper
- Larastan
- Security Advisories
- Solo for Laravel
- Request Factories - Test requests in Laravel without all the boilerplate.
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 for other area codes are welcome.
fake_phone_number();
// "+17044459994"
Updates
- Authentication services are now provided via Laravel Fortify.
- Cache prefix default changes from ending in
_cache_to-cache-. - Database prefix default changes from ending in
_database_to-database-. - Session default changes from ending in
_sessionto-session. - Shadcn default style is now
new-york-v4instead ofdefault. - Ziggy removed and replaced with Laravel Wayfinder.
统计信息
- 总下载量: 14
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-06-12