Laravel Laravel
  • Prologue

    • Lychee & LycheeOrg
    • Release Notes
  • Getting Started

    • Installation
    • Configuration
    • Docker
    • Update
    • Upgrade from v3
  • Advanced Topics

    • Settings
    • Keyboard Shortcuts
    • Advanced Setups
  • Frequently Asked Question

    • General
    • Installation, migration, upgrade, update
    • Troubleshooting
  • Contributing

    • Contribution Guide
    • API Documentation
    • Lychee logic overview
    • Directory Structure
    • Front-end
    • Livewire Front-end (alpha)
  • Laravel

Directory Structure

  • The Root Directory
    • The App Directory
    • The Bootstrap Directory
    • The Config Directory
    • The Database Directory
    • The Public Directory
    • The Resources Directory
    • The Routes Directory
    • The Storage Directory
    • The Tests Directory
    • The vendor Directory
  • The App Directory
    • The Console Directory
    • The ControllerFunctions Directory
    • The Exceptions Directory
    • The Http Directory
    • The Image Directory
    • The Locale Directory
    • The Metadata Directory
    • The ModelFunctions Directory
    • The Providers Directory
    • The Redirection Directory

The Root Directory

The App Directory

The app directory contains the core code of your application. We'll explore this directory in more detail soon; however, almost all of the classes in your application will be in this directory.

The Bootstrap Directory

The bootstrap directory contains the app.php file which bootstraps Lychee. This directory also houses a cache directory which contains framework generated files for performance optimization such as the route and services cache files.

The Config Directory

The config directory, as the name implies, contains all of Lychee's configuration files. It's a great idea to read through all of these files and familiarize yourself with all of the options available to you.

The Database Directory

The database directory contains your database migrations, model factories, and seeds. If you wish, you may also use this directory to hold an SQLite database.

The Public Directory

The public directory contains the index.php file, which is the entry point for all requests entering Lychee and configures autoloading.

The Resources Directory

The resources directory contains your views.

The Routes Directory

The routes directory contains all of the route definitions for Lychee. Several route files are included with Lychee: admin.php, web.php, api.php, console.php and channels.php. We only use the first two.

The web.php file contains routes that the RouteServiceProvider places in the web middleware group, which provides session state, CSRF protection, and cookie encryption.

The admin.php file contains routes with the same requirement as in web.php while adding an admin middleware to protect them.

The Storage Directory

The storage directory contains your compiled Blade templates, file based sessions, file caches, and other files generated by the framework. This directory is segregated into app, framework, and logs directories. The app directory may be used to store any files generated by your application. The framework directory is used to store framework generated files and caches. Finally, the logs directory contains Laravel's log files (useful in case of hard crash).

The Tests Directory

The tests directory contains your automated tests. An example PHPUnit test is provided out of the box. Each test class should be suffixed with the word Test. You may run your tests using the commands: make test, phpunit or php vendor/bin/phpunit commands.

{note} This directory is not provided in the release zip file in order to reduce the size of the archive.

The vendor Directory

The vendor directory contains your Composer dependencies.

{tip} While this directory is not provided if you use git to manage your Lychee installation, we provide it in the release wip file.

The App Directory

The majority of Lychee is housed in the app directory. By default, this directory is namespaced under App and is autoloaded by Composer using the PSR-4 autoloading standard.

The app directory contains a variety of additional directories such as Console, Http, and Providers. Think of the Console and Http directories as providing an API into the core of your application. The HTTP protocol and CLI are both mechanisms to interact with Lychee, but do not actually contain application logic. In other words, they are two ways of issuing commands to Lychee. The Console directory contains all of the Artisan commands, while the Http directory contains your controllers, middleware, and requests.

The Console Directory

The Console directory contains all of the custom Artisan commands for Lychee. These commands may be generated using the make:command command.

The ControllerFunctions Directory

The ControllerFunctions directory houses some of the Logic of Lychee. It currently is dedicated to the Installation and Update process. It should hold more logic in the future.

The Exceptions Directory

The Exceptions directory contains Lychee's exception handler. If you would like to customize how your exceptions are logged or rendered, you should modify the Handler class in this directory.

The Http Directory

The Http directory contains your controllers, middleware, and form requests. Almost all of the logic to handle requests entering your application will be placed in this directory.

It currently houses some logic which should be refactored away.

The Image Directory

The Image directory contains our image handler. We provide here two ways to manipulate pictures:

  • with GD,
  • with imagick.

The Locale Directory

The Locale directory contains at the moment all the translations strings for Lychee. This inhouse solution needs to be refactored to follow a better design.

The Metadata Directory

The Metatdata directory contains logic related to data such as Exif information, geodecoding, lychee version, GitHub monitoring...

The ModelFunctions Directory

The ModelFunctions directory contains logic related to the models. This aims to improve interaction between models without clustering their files with logic.

The Providers Directory

The Providers directory contains all of the service providers for Lychee. Service providers bootstrap Lychee by binding services in the service container, registering events, or performing any other tasks to prepare your application for incoming requests.

The Redirection Directory

The Redirection directory houses main redirection to handle the installation (database not set) and safety cases (security key not set).

{tip} Caught a mistake or want to contribute to the documentation? Edit this page on Github!