├── source ├── favicon.ico ├── assets │ ├── img │ │ ├── logo.png │ │ ├── logo-large.png │ │ ├── icon-terminal.svg │ │ ├── magnifying-glass.svg │ │ ├── icon-stack.svg │ │ ├── icon-window.svg │ │ └── logo.svg │ └── build │ │ ├── mix-manifest.json │ │ ├── js │ │ └── main.js.LICENSE.txt │ │ └── css │ │ ├── main.css.map │ │ └── main.css ├── _nav │ ├── menu.blade.php │ ├── menu-item.blade.php │ ├── menu-toggle.blade.php │ └── search-input.blade.php ├── _assets │ ├── sass │ │ ├── main.scss │ │ ├── _navigation.scss │ │ └── _search.scss │ └── js │ │ └── main.js ├── 404.blade.php ├── _layouts │ ├── documentation.blade.php │ └── master.blade.php ├── docs │ ├── tinker-repl.md │ ├── send-desktop-notifications.md │ ├── http-client.md │ ├── service-providers.md │ ├── run-tasks.md │ ├── navigation.md │ ├── environment-variables.md │ ├── custom-404-page.md │ ├── introduction.md │ ├── database.md │ ├── web-browser-automation.md │ ├── create-a-logo.md │ ├── installation.md │ ├── logging.md │ ├── task-scheduling.md │ ├── testing.md │ ├── configuration.md │ ├── filesystem.md │ ├── build-interactive-menus.md │ ├── contributing.md │ ├── commands.md │ ├── build-a-standalone-application.md │ ├── exception-handler.md │ └── upgrade.md └── index.blade.php ├── .gitignore ├── config.staging.php ├── config.production.php ├── composer.json ├── tasks ├── bin.js └── build.js ├── bootstrap.php ├── webpack.mix.js ├── config.php ├── listeners └── GenerateSitemap.php ├── package.json ├── navigation.php ├── tailwind.config.js ├── README.md └── composer.lock /source/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laravel-zero/website/HEAD/source/favicon.ico -------------------------------------------------------------------------------- /source/assets/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laravel-zero/website/HEAD/source/assets/img/logo.png -------------------------------------------------------------------------------- /source/assets/img/logo-large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laravel-zero/website/HEAD/source/assets/img/logo-large.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /build_local/ 2 | /build_staging/ 3 | /build_production/ 4 | /build_staging/ 5 | /node_modules/ 6 | /vendor/ 7 | .DS_Store 8 | .idea -------------------------------------------------------------------------------- /source/_nav/menu.blade.php: -------------------------------------------------------------------------------- 1 | @php $level = $level ?? 0 @endphp 2 | 3 |
13 | Need to update this page? See the Jigsaw documentation. 14 |
15 |
29 |
30 | Get more details: [https://github.com/nunomaduro/laravel-console-task](https://github.com/nunomaduro/laravel-console-task).
31 |
32 |
--------------------------------------------------------------------------------
/source/_assets/js/main.js:
--------------------------------------------------------------------------------
1 | window.docsearch = require('docsearch.js');
2 |
3 | import hljs from 'highlight.js/lib/highlight';
4 |
5 | hljs.registerLanguage('bash', require('highlight.js/lib/languages/bash'));
6 | hljs.registerLanguage('css', require('highlight.js/lib/languages/css'));
7 | hljs.registerLanguage('diff', require('highlight.js/lib/languages/diff'));
8 | hljs.registerLanguage('html', require('highlight.js/lib/languages/xml'));
9 | hljs.registerLanguage('javascript', require('highlight.js/lib/languages/javascript'));
10 | hljs.registerLanguage('json', require('highlight.js/lib/languages/json'));
11 | hljs.registerLanguage('markdown', require('highlight.js/lib/languages/markdown'));
12 | hljs.registerLanguage('php', require('highlight.js/lib/languages/php'));
13 | hljs.registerLanguage('scss', require('highlight.js/lib/languages/scss'));
14 | hljs.registerLanguage('yaml', require('highlight.js/lib/languages/yaml'));
15 |
16 | document.querySelectorAll('pre code').forEach((block) => {
17 | hljs.highlightBlock(block);
18 | });
19 |
--------------------------------------------------------------------------------
/source/docs/navigation.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Navigation
3 | description: Building a navigation menu for your site
4 | extends: _layouts.documentation
5 | section: content
6 | ---
7 |
8 | # Navigation {#navigation}
9 |
10 | The navigation menu in the left-hand sidebar is defined using an array in `navigation.php`. Nested pages can be added by using the `children` associative array.
11 |
12 | ```php
13 | [
18 | 'url' => 'docs/getting-started',
19 | 'children' => [
20 | 'Customizing Your Site' => 'docs/customizing-your-site',
21 | 'Navigation' => 'docs/navigation',
22 | 'Algolia DocSearch' => 'docs/algolia-docsearch',
23 | 'Custom 404 Page' => 'docs/custom-404-page',
24 | ],
25 | ],
26 | 'Jigsaw Docs' => 'https://jigsaw.tighten.co/docs/installation',
27 | ];
28 |
29 | // config.php
30 | 'navigation' => require_once('navigation.php'),
31 |
32 | // blade files
33 | $page->navigation
34 | ```
35 |
--------------------------------------------------------------------------------
/config.php:
--------------------------------------------------------------------------------
1 | '',
7 | 'production' => false,
8 | 'siteName' => 'Laravel Zero',
9 | 'siteDescription' => 'Micro-framework for console applications',
10 |
11 | // Algolia DocSearch credentials
12 | 'docsearchApiKey' => 'ac0bd380724d207df97763a999031e82',
13 | 'docsearchIndexName' => 'laravel-zero',
14 |
15 | // navigation menu
16 | 'navigation' => require_once('navigation.php'),
17 |
18 | // helpers
19 | 'isActive' => function ($page, $path) {
20 | return Str::endsWith(trimPath($page->getPath()), trimPath($path));
21 | },
22 | 'isActiveParent' => function ($page, $menuItem) {
23 | if (is_object($menuItem) && $menuItem->children) {
24 | return $menuItem->children->contains(function ($child) use ($page) {
25 | return trimPath($page->getPath()) == trimPath($child);
26 | });
27 | }
28 | },
29 | 'url' => function ($page, $path) {
30 | return Str::startsWith($path, 'http') ? $path : '/' . trimPath($path);
31 | },
32 | ];
33 |
--------------------------------------------------------------------------------
/source/docs/environment-variables.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Environment Variables
3 | description: Dotenv component loads environment variables from a .env file
4 | extends: _layouts.documentation
5 | section: content
6 | ---
7 |
8 | # Environment Variables
9 |
10 | Using the `app:install` Artisan command you can install the `dotenv` component:
11 | ```bash
12 | php Need to update this page? See the documentation here.
24 |
38 |
39 |
22 |
23 | This command will install dependencies needed and publishes a config file under `config/logo.php`.
24 |
25 | ### Using a different font
26 |
27 | Under the hood the `logo` component uses the [`laminas/laminas-text`](https://github.com/laminas/laminas-text) package which renders text using fonts called "figlets".
28 |
29 | By default Laravel Zero uses the `big.flf` FIGlet file by Glenn Chappell. Additional FIGlet files can be downloaded from [figlet.org](http://www.figlet.org/fontdb.cgi) or created using FIGlet editing software.
30 |
31 | Once a font has been downloaded, the `logo.font` value can be set in the config to provide the full path to the FIGlet file.
32 |
33 | ```diff
34 | // config/logo.php
35 | - 'font' => \LaravelZero\Framework\Components\Logo\FigletString::DEFAULT_FONT,
36 | + 'font' => resources_path('fonts/doom.flf'),
37 | ```
38 |
39 | For more details, check out the [Laminas docs](https://docs.laminas.dev/laminas-text/figlet) on FIGlets.
40 |
--------------------------------------------------------------------------------
/tasks/build.js:
--------------------------------------------------------------------------------
1 | let argv = require('yargs').argv;
2 | let bin = require('./bin');
3 | let command = require('node-cmd');
4 |
5 | let BrowserSync = require('browser-sync');
6 | let BrowserSyncPlugin = require('browser-sync-webpack-plugin');
7 | let ExtraWatchWebpackPlugin = require('extra-watch-webpack-plugin');
8 |
9 | let browserSyncInstance;
10 | let env = argv.e || argv.env || 'local';
11 | let port = argv.p || argv.port || 3000;
12 |
13 | module.exports = {
14 | jigsaw: {
15 | apply(compiler) {
16 | compiler.hooks.done.tap('DonePlugin', (compilation) => {
17 | command.get(bin.path() + ' build -q ' + env, (error, stdout, stderr) => {
18 | console.log(error ? stderr : stdout);
19 |
20 | if (browserSyncInstance) {
21 | browserSyncInstance.reload();
22 | }
23 | });
24 | });
25 | }
26 | },
27 |
28 | watch: function (paths) {
29 | return new ExtraWatchWebpackPlugin({
30 | files: paths,
31 | });
32 | },
33 |
34 | browserSync: function (proxy) {
35 | return new BrowserSyncPlugin({
36 | notify: false,
37 | port: port,
38 | proxy: proxy,
39 | server: proxy ? null : { baseDir: 'build_' + env + '/' },
40 | },
41 | {
42 | reload: false,
43 | callback: function() {
44 | browserSyncInstance = BrowserSync.get('bs-webpack-plugin');
45 | },
46 | })
47 | },
48 | };
49 |
--------------------------------------------------------------------------------
/navigation.php:
--------------------------------------------------------------------------------
1 | [
5 | 'url' => 'docs/introduction',
6 | ],
7 | 'Installation' => [
8 | 'url' => 'docs/installation',
9 | ],
10 | 'Usage' => [
11 | 'url' => 'docs/commands',
12 | 'children' => [
13 | 'Commands' => 'docs/commands',
14 | 'Service Providers' => 'docs/service-providers',
15 | 'Configuration' => 'docs/configuration',
16 | 'Testing' => 'docs/testing',
17 | ],
18 | ],
19 | 'Exception handler' => [
20 | 'url' => 'docs/exception-handler',
21 | ],
22 | 'Add-ons' => [
23 | 'url' => 'docs/database',
24 | 'children' => [
25 | 'Database' => 'docs/database',
26 | 'Logging' => 'docs/logging',
27 | 'Filesystem' => 'docs/filesystem',
28 | 'Run tasks' => 'docs/run-tasks',
29 | 'Create a logo' => 'docs/create-a-logo',
30 | 'Build interactive menus' => 'docs/build-interactive-menus',
31 | 'Send desktop notifications' => 'docs/send-desktop-notifications',
32 | 'Web Browser Automation' => 'docs/web-browser-automation',
33 | 'Environment Variables' => 'docs/environment-variables',
34 | 'Build a standalone application' => 'docs/build-a-standalone-application',
35 | 'Tinker REPL' => 'docs/tinker-repl',
36 | 'HTTP Client' => 'docs/http-client',
37 | ],
38 | ],
39 | 'Upgrade' => [
40 | 'url' => 'docs/upgrade',
41 | ],
42 | 'Contributing' => [
43 | 'url' => 'docs/contributing',
44 | ],
45 | ];
46 |
--------------------------------------------------------------------------------
/source/docs/installation.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Installation
3 | description: Create a new Laravel Zero project
4 | extends: _layouts.documentation
5 | section: content
6 | ---
7 |
8 | # Installation
9 |
10 | > **Requires [PHP 7.3+](https://php.net/releases)**
11 |
12 | Laravel Zero utilizes [Composer](https://getcomposer.org) to manage its dependencies. So, before using Laravel Zero, make sure you have Composer installed on your machine.
13 |
14 | #### Via Laravel Zero Installer
15 |
16 | First, download the Laravel Zero installer using Composer:
17 |
18 | ```bash
19 | composer global require "laravel-zero/installer"
20 | ```
21 |
22 | Make sure to place composer's system-wide vendor bin directory in your `$PATH` so the laravel Zero executable can be located by your system. This directory exists in different locations based on your operating system. On macOS and GNU/Linux distributions, it's `$HOME/.composer/vendor/bin`.
23 |
24 | Once installed, the `laravel-zero new` command will create a fresh Laravel Zero installation in the directory you specify. For instance, `laravel-zero new movie-cli` will create a directory named `movie-cli` containing a fresh Laravel Zero installation with all of Laravel Zero's dependencies already installed:
25 |
26 | ```bash
27 | laravel-zero new movie-cli
28 | ```
29 |
30 | #### Via Composer Create-Project
31 |
32 | Alternatively, you may also install Laravel Zero by issuing the Composer `create-project` command in your terminal:
33 |
34 | ```bash
35 | composer create-project --prefer-dist laravel-zero/laravel-zero movie-cli
36 | ```
37 |
38 | You will then need to run the `app:rename` command to rename your project:
39 |
40 | ```bash
41 | php application app:rename [movie-cli]
42 | ```
43 |
--------------------------------------------------------------------------------
/source/docs/logging.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Logging
3 | description: Robust logging services
4 | extends: _layouts.documentation
5 | section: content
6 | ---
7 |
8 | # Logging
9 |
10 | Using the `app:install` Artisan command you can install the `log` component:
11 | ```bash
12 | php
45 |
46 |
2 |
3 |
39 | 53 | Laravel Zero is a lightweight and modular micro-framework for developing fast and powerful console applications. Built on top of the Laravel components. 54 |
55 |65 | Laravel Zero has a simple and powerful syntax that enables developers to build very complex applications far more quickly than with any previous framework. 66 |
67 |77 | You’re free to dig through the source to see exactly how it works. See something that needs to be improved? Just send us a pull request on GitHub. 78 |
79 |