PHPackages                             whitecube/laravel-preset - 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. [Framework](/categories/framework)
4. /
5. whitecube/laravel-preset

ActiveLibrary[Framework](/categories/framework)

whitecube/laravel-preset
========================

Custom Laravel Preset for the Whitecube workflow.

v2.0.1(1y ago)412.9k↓46.4%1[5 issues](https://github.com/whitecube/laravel-preset/issues)[6 PRs](https://github.com/whitecube/laravel-preset/pulls)MITPHPPHP ^8.3

Since Jun 26Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/whitecube/laravel-preset)[ Packagist](https://packagist.org/packages/whitecube/laravel-preset)[ Docs](https://github.com/whitecube/laravel-preset)[ RSS](/packages/whitecube-laravel-preset/feed)WikiDiscussions vite Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (47)Used By (0)

Whitecube Laravel Preset
========================

[](#whitecube-laravel-preset)

This preset will install and setup everything that is needed for new Laravel projects at Whitecube.

To start a new project:

1. Create the new Laravel project

```
laravel new my-project
cd my-project
```

2. Install the preset

```
composer require whitecube/laravel-preset --dev
```

3. Activate the preset

```
php artisan ui whitecube
```

4. You're done! You can now compile, watch, etc!

```
yarn dev
yarn watch
yarn icons
yarn watch-icons
```

Everything you'd expect should be there, and you can get to work right away.

Setting up new Hiker projects
-----------------------------

[](#setting-up-new-hiker-projects)

After doing the above commands, do the following:

1. Add the Hiker repository to the `composer.json` file:

```
composer config repositories.hiker composer https://repo.hiker.dev
```

2. The, run the following terminal commands:

```
composer require hiker-dev/hiker
```

3. When prompted, add your Hiker.dev user &amp; license. You can store these credentials in a `auth.json`, but don't forget to add this file to the project's `.gitignore`!
4. Finally, run Hiker's installation command:

```
php artisan hiker:install
```

Publish the base files for common components
--------------------------------------------

[](#publish-the-base-files-for-common-components)

This package ships with a set of publishable components that will help setup the project's front-end basics in a few seconds. The following command will prompt for the components you can install:

```
php artisan publish:component
```

Creating new publishable components
-----------------------------------

[](#creating-new-publishable-components)

In order to create a publishable component, one should simply create a new "Publisher" class inside `src/Components/Publishers` and implement `Whitecube\LaravelPreset\Components\PublisherInterface` :

```
namespace Whitecube\LaravelPreset\Components\Publishers;

use Whitecube\LaravelPreset\Components\File;
use Whitecube\LaravelPreset\Components\FilesCollection;
use Whitecube\LaravelPreset\Components\PublisherInterface;

class Wysiwyg implements PublisherInterface
{
    /**
     * Get the component's displayable name.
     */
    public function label(): string
    {
        return 'WYSIWYG section';
    }

    /**
     * Let the publisher prompt for eventual extra input
     * and return a collection of publishable files.
     */
    public function handle(): FilesCollection
    {
        $style = File::makeFromStub(
            stub: 'components/wysiwyg/part.scss',
            destination: resource_path('sass/parts/_wysiwyg.scss'),
        );

        $view = File::makeFromStub(
            stub: 'components/wysiwyg/view.blade.php',
            destination: resource_path('views/components/wysiwyg.blade.php'),
        );

        return FilesCollection::make([$style, $view]);
    }

    /**
     * Get the component's usage instructions
     */
    public function instructions(): ?string
    {
        return "1. Add `@import 'parts/wysiwyg';` to `resources/sass/app.scss`\r\n2. Use the blade component: `Some content`";
    }
}
```

Most of the heavy-lifting will be achieved inside the publisher's `handle()` method. For instance, it's a great place to prompt for additional component-specific information and configure the publishable files accordingly.

The `handle()` method's main purpose is to collect and return the publishable files, that's why this package provides a `File` class with several useful methods and features. First, you can choose to create a `File` instance using one of these methods:

- `File::makeFromStub(string $destination, string $stub)`: useful when working with existing files ;
- `File::make(string $destination, string $content, ?string $origin = null)`: useful when creating files from scratch.

Most of the time, `File::makeFromStub` should be used in order to keep a clear commit history on the component's original files somewhere in this package's `components/[your-component]` directory.

These `File` instances can be manipulated before publication with a few useful methods:

- `$sassFile->replaceVariableValue('wysiwyg_width_columns', 10)`;
- `$sassFile->replaceBemBase('wysiwyg', 'foo')`;
- `$bladeFile->replaceBemBase('wysiwyg', 'foo')`;

Of course, Laravel Prompts can be used anywhere inside a publisher's `handle()` method, which is useful for file configuration:

```
use function Laravel\Prompts\text;

$style = File::makeFromStub(
    stub: 'components/wysiwyg/part.scss',
    destination: resource_path('sass/parts/_wysiwyg.scss'),
);

$width = text(
    label: 'How many columns should the WYSIWYG\'s container width be?',
    default: 10,
    hint: 'Based on a 12 columns grid',
);

$style->replaceVariableValue('wysiwyg_width_columns', $width);
```

###  Health Score

48

—

FairBetter than 95% of packages

Maintenance47

Moderate activity, may be stable

Popularity30

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity83

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

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

Every ~60 days

Recently: every ~152 days

Total

28

Last Release

525d ago

Major Versions

v0.1.3 → v1.0.02022-06-23

v1.0.5 → v2.0.02023-04-13

PHP version history (5 changes)v0.0.1PHP ^7.1

v0.0.2PHP ^7.3

v0.0.5PHP ^7.3|^8.0

v1.0.0PHP ^8.0

v2.0.1PHP ^8.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8435657?v=4)[Whitecube](/maintainers/Whitecube)[@whitecube](https://github.com/whitecube)

---

Top Contributors

[![voidgraphics](https://avatars.githubusercontent.com/u/9298484?v=4)](https://github.com/voidgraphics "voidgraphics (65 commits)")[![theokbokki](https://avatars.githubusercontent.com/u/90846584?v=4)](https://github.com/theokbokki "theokbokki (49 commits)")[![toonvandenbos](https://avatars.githubusercontent.com/u/5635557?v=4)](https://github.com/toonvandenbos "toonvandenbos (37 commits)")[![LisBomb](https://avatars.githubusercontent.com/u/47633653?v=4)](https://github.com/LisBomb "LisBomb (17 commits)")[![LysanderH](https://avatars.githubusercontent.com/u/34277017?v=4)](https://github.com/LysanderH "LysanderH (7 commits)")

---

Tags

whitecubelaravel-preset

### Embed Badge

![Health badge](/badges/whitecube-laravel-preset/health.svg)

```
[![Health](https://phpackages.com/badges/whitecube-laravel-preset/health.svg)](https://phpackages.com/packages/whitecube-laravel-preset)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.7k509.9M17.0k](/packages/laravel-framework)[livewire/livewire

A front-end framework for Laravel.

23.5k75.5M1.8k](/packages/livewire-livewire)[laravel/octane

Supercharge your Laravel application's performance.

4.0k21.5M159](/packages/laravel-octane)[laravel/boost

Laravel Boost accelerates AI-assisted development by providing the essential context and structure that AI needs to generate high-quality, Laravel-specific code.

3.5k10.6M274](/packages/laravel-boost)[bagisto/bagisto

Bagisto Laravel E-Commerce

26.2k161.6k7](/packages/bagisto-bagisto)[laravel/reverb

Laravel Reverb provides a real-time WebSocket communication backend for Laravel applications.

1.6k9.4M48](/packages/laravel-reverb)

PHPackages © 2026

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