Download the PHP package laravel-bridge/scratch without Composer
On this page you can find all versions of the php package laravel-bridge/scratch. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download laravel-bridge/scratch
More information about laravel-bridge/scratch
Files in laravel-bridge/scratch
Package scratch
Short Description For project from scratch
License MIT
Informations about the package scratch
Start Laravel project from scratch.
Installation
Run the following command to require package:
composer require laravel-bridge/scratch
Usage
Setup when you want to use the package
Database
Require
illuminate/databaseandilluminate/events
Method setupDatabaseConfig() has 3 arguments, the following is signature:
$nameis the database name.$connectionis the database config only.$defaultwill set the default database if true.
Method setupDatabaseConfigs() has 2 arguments, the following is signature:
$connectionsis the all connections config.$defaultspecify the connection is default.
Examples
index.php example for Database:
Eloquent is easy, too.
View
Require
illuminate/view, requireilluminate/translationwhen need translation.
index.php example for View:
Template example view.blade.php:
Logging
Require
illuminate/logandilluminate/events
Method setupLogger() has 3 arguments, the following is signature:
$nameis the Log name, and use FacadeLog::driver($name)to specify.$loggeris the instance implementedPsr\Log\LoggerInterface.$defaultwill set the default log driver if true.
Here is a testing example:
Configuration
The configuration will use illuminate/config package. Following is the priority.
- Setup method config or setup step
- Configuration Loader or bootstrap step
Facade
Use withFacades() to active Facade and register short class:
Bootstrap
Bootstrap is a lifecycle in Laravel Kernel. The following is bootstrapper order.
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
Projects:
Libraries:
Thanks
- Idea by @recca0120
- Logo by @ycs77
All versions of scratch with dependencies
illuminate/config Version ^5.6 | ^6 | ^7 | ^8
illuminate/container Version ^5.6 | ^6 | ^7 | ^8
illuminate/support Version ^5.6 | ^6 | ^7 | ^8