PHPackages                             laravel-bridge/scratch - 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. laravel-bridge/scratch

ActiveLibrary[Framework](/categories/framework)

laravel-bridge/scratch
======================

For project from scratch

1.7.0(5y ago)102.6k2MITPHPPHP ^7.1 | ^8.0CI failing

Since Feb 2Pushed 5y ago3 watchersCompare

[ Source](https://github.com/laravel-bridge/scratch)[ Packagist](https://packagist.org/packages/laravel-bridge/scratch)[ RSS](/packages/laravel-bridge-scratch/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (16)Versions (29)Used By (2)

[![banner](https://camo.githubusercontent.com/826f8ac90c9a36fd9d3d3e6bd9e740ab3a573a5e0b23280c2c95ac9f0fcc670a/68747470733a2f2f6c61726176656c2d6272696467652e6769746875622e696f2f62616e6e65722e737667)](https://camo.githubusercontent.com/826f8ac90c9a36fd9d3d3e6bd9e740ab3a573a5e0b23280c2c95ac9f0fcc670a/68747470733a2f2f6c61726176656c2d6272696467652e6769746875622e696f2f62616e6e65722e737667)

[![tests](https://github.com/laravel-bridge/scratch/workflows/tests/badge.svg)](https://github.com/laravel-bridge/scratch/workflows/tests/badge.svg)[![codecov](https://camo.githubusercontent.com/c80a67de3231189d22c4b528c9bc92bc89e5f9da34d22ff0d2fe2e87e7daa0e6/68747470733a2f2f636f6465636f762e696f2f67682f6c61726176656c2d6272696467652f736372617463682f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/laravel-bridge/scratch)[![Codacy Badge](https://camo.githubusercontent.com/a6d8d145b344fd555b25dace085dd16bf6d01da3d26bec339be3bd81665e9d0a/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f6630623538366430333661613439323461333433303531333339623962343333)](https://www.codacy.com/gh/laravel-bridge/scratch)[![Latest Stable Version](https://camo.githubusercontent.com/974687211022425f8ebd910294632fe2b76db39bee627b87b433aefc188be7f6/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2d6272696467652f736372617463682f762f737461626c65)](https://packagist.org/packages/laravel-bridge/scratch)[![Total Downloads](https://camo.githubusercontent.com/9c8542455daa7e21d7dd606768d949c99c433af37edb5a292186bb3ccc3e1cf5/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2d6272696467652f736372617463682f642f746f74616c2e737667)](https://packagist.org/packages/laravel-bridge/scratch)[![License](https://camo.githubusercontent.com/5572d6cea6d1100d23d2fd9da220b7871aca952d7dd92b273bde4ae2118823fe/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2d6272696467652f736372617463682f6c6963656e7365)](https://packagist.org/packages/laravel-bridge/scratch)

Start Laravel project from scratch.

Installation
------------

[](#installation)

Run the following command to require package:

```
composer require laravel-bridge/scratch

```

Usage
-----

[](#usage)

Setup when you want to use the package

### Database

[](#database)

> Require `illuminate/database` and `illuminate/events`

Method `setupDatabaseConfig()` has 3 arguments, the following is signature:

```
public function setupDatabaseConfig(string $name, array $connection, bool $default = false);
```

- `$name` is the database name.
- `$connection` is the database config only.
- `$default` will set the default database if true.

Method `setupDatabaseConfigs()` has 2 arguments, the following is signature:

```
public function setupDatabaseConfig(array $connections, string $default = 'default');
```

- `$connections` is the all connections config.
- `$default` specify the connection is default.

#### Examples

[](#examples)

[index.php](/examples/database/index.php) example for Database:

```
use LaravelBridge\Scratch\Application;

$connections = [
    'driver' => 'sqlite',
    'database' => __DIR__ . '/sqlite.db',
];

$app = Application::getInstance()
    ->setupDatabaseConfig('default', $connections, true)
    ->bootstrap();
```

Eloquent is easy, too.

```
use Illuminate\Database\Eloquent\Model;

class User extends Model
{

}

// ---

$user = new User();
$user->username = 'root';
$user->password = 'password';

$user->save();

User::all()->toArray();
```

### View

[](#view)

> Require `illuminate/view`, require `illuminate/translation` when need translation.

[index.php](/examples/view/index.php) example for View:

```
use LaravelBridge\Scratch\Application;

Application::getInstance()
    ->setupTranslator(__DIR__ . '/lang')
    ->setupView(__DIR__, __DIR__ . '/compiled')
    ->withFacades()
    ->bootstrap();

echo View::make('view', ['rows' => [1, 2, 3]]);
```

Template example [view.blade.php](/examples/view/view.blade.php):

```
@foreach ($rows as $row)
    {{ $row }}
@endforeach
```

### Logging

[](#logging)

> Require `illuminate/log` and `illuminate/events`

Method `setupLogger()` has 3 arguments, the following is signature:

```
public function setupLogger(string $name, LoggerInterface $logger, bool $default = false);
```

- `$name` is the Log name, and use Facade `Log::driver($name)` to specify.
- `$logger` is the instance implemented [`Psr\Log\LoggerInterface`](https://www.php-fig.org/psr/psr-3/).
- `$default` will set the default log driver if true.

Here is a testing example:

```
$spy = new TestHandler();

$logger = new Monolog\Logger('test');
$logger->pushHandler($spy);

$this->target->setupLogger('test', $logger, true)
    ->bootstrap();

Log::info('log_test');

$this->assertTrue($spy->hasInfoRecords());
```

Configuration
-------------

[](#configuration)

The configuration will use `illuminate/config` package. Following is the priority.

1. Setup method config or setup step
2. Configuration Loader or bootstrap step

Facade
------

[](#facade)

Use `withFacades()` to active Facade and register short class:

```
$app->withFacades();

View::make(); // It's works
```

Bootstrap
---------

[](#bootstrap)

Bootstrap is a lifecycle in Laravel [Kernel](https://github.com/laravel/framework/blob/v7.1.0/src/Illuminate/Foundation/Http/Kernel.php#L37-L42). The following is bootstrapper order.

```
\Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables::class
\Illuminate\Foundation\Bootstrap\LoadConfiguration::class
\Illuminate\Foundation\Bootstrap\HandleExceptions::class
\Illuminate\Foundation\Bootstrap\RegisterFacades::class
\Illuminate\Foundation\Bootstrap\RegisterProviders::class
\Illuminate\Foundation\Bootstrap\BootProviders::class

```

In Scratch application, we can load config functionally. and use `withFacades()` to register Facade first. finally, call `ServiceProvider::register()` on every provider when call `bootstrap()`. Next, call `ServiceProvider::boot()` on every provider, just like Laravel Kernel.

`bootstrap()` has an argument `$withAllLaravelProviders`, register all laravel provider when true. Also, It's default true. However, use `withoutLaravelProvider()` if you don't want use some Laravel providers.

Example Projects or Libraries
-----------------------------

[](#example-projects-or-libraries)

Projects:

- [Schemarkdown](https://github.com/MilesChou/schemarkdown)
- [Laravel Eloquent Generator](https://github.com/104corp/laravel-eloquent-generator)

Libraries:

- [Laravel Bridge - Slim](https://github.com/laravel-bridge/slim)

Thanks
------

[](#thanks)

- Idea by [@recca0120](https://github.com/recca0120/laravel-bridge)
- Logo by [@ycs77](https://github.com/ycs77)

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 98.8% 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

Every ~15 days

Recently: every ~67 days

Total

28

Last Release

1883d ago

Major Versions

v0.9.2 → v1.0.02020-03-11

PHP version history (3 changes)v0.1.0PHP &gt;=7.1

1.6.0PHP ^7.1

1.7.0PHP ^7.1 | ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/20872dcc4b888075f03819d5470db8198ffcc5f9edb791aba5f007e34355a6c9?d=identicon)[MilesChou](/maintainers/MilesChou)

---

Top Contributors

[![MilesChou](https://avatars.githubusercontent.com/u/1258752?v=4)](https://github.com/MilesChou "MilesChou (81 commits)")[![ycs77](https://avatars.githubusercontent.com/u/38133356?v=4)](https://github.com/ycs77 "ycs77 (1 commits)")

---

Tags

laravellaravel

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/laravel-bridge-scratch/health.svg)

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

###  Alternatives

[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.4k85.0M532](/packages/laravel-passport)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[laravel-zero/framework

The Laravel Zero Framework.

3371.4M369](/packages/laravel-zero-framework)[laravel/lumen-framework

The Laravel Lumen Framework.

1.5k26.2M709](/packages/laravel-lumen-framework)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

71510.9M66](/packages/laravel-mcp)[laravel/pennant

A simple, lightweight library for managing feature flags.

57311.1M53](/packages/laravel-pennant)

PHPackages © 2026

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