Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/pages/6.0/01.quick-start/docs.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Quick Start Guide
description: The official documentation for UserFrosting, a PHP framework and full-featured user management application.
description: Get UserFrosting up and running quickly. This guide walks you through installing and launching UserFrosting on your local machine.
---

UserFrosting is a free, open-source jumping-off point for building user-centered web applications with PHP and Javascript. It comes with a sleek, modern interface, basic user account features, and an administrative user management system - all fully functioning out of the box.
Expand All @@ -27,7 +27,7 @@ UserFrosting has a few system requirements. You need to make sure your local Use
Use Composer to create a new project with the latest version of UserFrosting into a `UserFrosting` folder. This will clone the skeleton repository and run the installation process.

```bash
composer create-project userfrosting/userfrosting UserFrosting "^6.0-beta"
composer create-project userfrosting/userfrosting UserFrosting "^6.0"
```

> [!TIP]
Expand Down
8 changes: 4 additions & 4 deletions app/pages/6.0/03.structure/02.dependencies/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ While UserFrosting uses dozens of dependencies, here's a rundown of the most imp
## Slim 4
**[Slim](https://www.slimframework.com)** is a PHP _micro framework_ that helps you quickly write simple yet powerful web applications and APIs. Slim is the backbone of UserFrosting. To be more precise, **UserFrosting _is_ a Slim Application**!

Except for the Bakery system (which uses _[Symfony Console](#symfony-console-5)_), UserFrosting uses Slim at every level to perform middleware management, route collections, and everything else needed to actually display a web page.
Except for the Bakery system (which uses _[Symfony Console](#symfony-console-6)_), UserFrosting uses Slim at every level to perform middleware management, route collections, and everything else needed to actually display a web page.

## PHP-DI 7
**[PHP-DI](https://php-di.org)** is a _dependency injection container_. Dependency injection is one of the fundamental pillars of modern object-oriented software design. It is used extensively throughout UserFrosting to glue all services together while maintaining great flexibility to extend the basics functionalities of UserFrosting to create your own project. We'll explain dependency injection in detail in a later chapter. For now, it's only important to note **PHP-DI** is the dependency manager used by UserFrosting 5 to handle all dependency injection.
**[PHP-DI](https://php-di.org)** is a _dependency injection container_. Dependency injection is one of the fundamental pillars of modern object-oriented software design. It is used extensively throughout UserFrosting to glue all services together while maintaining great flexibility to extend the basics functionalities of UserFrosting to create your own project. We'll explain dependency injection in detail in a later chapter. For now, it's only important to note **PHP-DI** is the dependency manager used by **UserFrosting** to handle all dependency injection.

## Eloquent (Laravel 10)
**[Eloquent](https://laravel.com/docs/10.x/eloquent)** is part of the Laravel Framework. Eloquent makes it enjoyable to interact with a database. When using Eloquent, each database table has a corresponding "Model" that is used to interact with that table. In addition to retrieving records from the database table, Eloquent models allow you to insert, update, and delete records from the table as well.
Expand All @@ -26,8 +26,8 @@ Eloquent is one of the most powerful and easy to use tools available to interact
## Twig 3
**[Twig](https://twig.symfony.com/doc/)** is a flexible, fast, and secure template engine for PHP. Initially developed for the Symfony framework, Twig is easy to use. Twig provides the necessary tools to use the data generated by PHP and render the HTML page the end user gets to see.

## Symfony Console 5
**[Symfony Console](https://symfony.com/doc/5.4/components/console.html)** eases the creation of beautiful and testable command line interfaces. This is used to power the **Bakery** command line interface tool used by UserFrosting.
## Symfony Console 6
**[Symfony Console](https://symfony.com/doc/6.4/components/console.html)** eases the creation of beautiful and testable command line interfaces. This is used to power the **Bakery** command line interface tool used by UserFrosting.

## Vite
**[Vite](https://vitejs.dev)** is a modern build tool that provides lightning-fast development with Hot Module Replacement (HMR), instant server start, and optimized production builds. Vite is used by UserFrosting to build and serve all frontend assets including CSS, JavaScript, TypeScript, and Vue components.
Expand Down
2 changes: 1 addition & 1 deletion app/pages/6.0/03.structure/03.framework/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ The documentation for each part is embedded in the next chapters, but you can st
- [Cache](https://github.com/userfrosting/framework/tree/main/src/Cache) : Wrapper function for Laravel cache system for easier integration of the cache system in standalone projects.
- [Config](https://github.com/userfrosting/framework/tree/main/src/Config) : Configuration files aggregator
- [Fortress](https://github.com/userfrosting/framework/tree/main/src/Fortress) : A schema-driven system for elegant whitelisting, transformation and validation of user input, on both the client and server sides, from a unified set of rules.
- [i81n](https://github.com/userfrosting/framework/tree/main/src/I18n) : The I18n module handles translation tasks.
- [I18n](https://github.com/userfrosting/framework/tree/main/src/I18n) : The I18n module handles translation tasks.
- [Session](https://github.com/userfrosting/framework/tree/main/src/Session) : PHP Session wrapper
- [UniformResourceLocator](https://github.com/userfrosting/framework/tree/main/src/UniformResourceLocator) : The Uniform Resource Locator module handles resource aggregation and stream wrapper
2 changes: 1 addition & 1 deletion app/pages/6.0/03.structure/04.sprinkles/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Your app can have as many sprinkles as you want. A sprinkle could even depend on

## Bundled Sprinkles

A default UserFrosting installation comes with **four** sprinkles, each of which will be downloaded by [Composer](/installation/requirements/essential-tools-for-php#composer) in the `/vendor` directory during installation.
A default UserFrosting installation comes with **three sprinkles and one theme package**, each of which will be downloaded by [Composer](/installation/requirements/essential-tools-for-php#composer) in the `/vendor` directory during installation.

Because UserFrosting is modular, you can decide to use these bundled sprinkles or not. You may or may not need the functionality each provides in your app. We'll go over how to enable and disable them [later](/sprinkles/recipe#removing-default-sprinkles). For now, let's focus on their features.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ Now that your local development environment is setup and ready to go, it's final

Use Composer to create an empty project with the latest version of UserFrosting skeleton into a new `UserFrosting` folder:

<!-- TODO : UPDATE FOR OFFICIAL RELEASE -->
```bash
composer create-project userfrosting/userfrosting UserFrosting "^6.0" --stability=beta
composer create-project userfrosting/userfrosting UserFrosting "^6.0"
```

> [!TIP]
Expand Down Expand Up @@ -52,7 +51,7 @@ This starts the backend on [http://localhost:8080](http://localhost:8080).
**Terminal 2 - Start the Vite dev server:**

```bash
npm run dev
npm run vite:dev
```

This starts the Vite development server with Hot Module Replacement (HMR) for instant frontend updates.
Expand Down
34 changes: 17 additions & 17 deletions app/pages/6.0/04.installation/02.environment/02.docker/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ First, you'll need to install Docker. Just follow the installation instructions

For the next part, you'll need to use the command line. We'll use Composer (through a Docker image) to create an empty project, with the latest version of the UserFrosting skeleton, into a new `UserFrosting` subdirectory:

<!-- TODO : UPDATE FOR OFFICIAL RELEASE -->

```bash
docker run --rm -it -v "$(pwd):/app" composer create-project userfrosting/userfrosting UserFrosting "^6.0-beta" --no-scripts --no-install --ignore-platform-reqs
docker run --rm -it -v "$(pwd):/app" composer create-project userfrosting/userfrosting UserFrosting "^6.0" --no-scripts --no-install --ignore-platform-reqs
```

> [!TIP]
Expand All @@ -65,7 +65,7 @@ Now it's simply a matter of navigating to the directory containing the source co
2. Build each of the Docker Containers (this might take a while):

```bash
docker-compose build --no-cache
docker compose build --no-cache
```

3. Copy the `.env` template
Expand All @@ -76,7 +76,7 @@ Now it's simply a matter of navigating to the directory containing the source co
4. Start each Docker Container:

```bash
docker-compose up -d
docker compose up -d
```

5. Set some directory permissions (you may have to enter your root password):
Expand All @@ -90,13 +90,13 @@ Now it's simply a matter of navigating to the directory containing the source co
6. Install PHP dependencies:

```bash
docker-compose exec app composer update
docker compose exec app composer install
```

7. Install UserFrosting (database configuration and migrations, creation of admin user, etc.). You'll need to provide info to create the admin user:

```bash
docker-compose exec app php bakery bake
docker compose exec app php bakery bake
```

Now visit [http://localhost:8080](http://localhost:8080) to see your UserFrosting homepage!
Expand All @@ -108,12 +108,12 @@ You should see the default UserFrosting pages and be able to log in with the new
To stop the containers, run:

```bash
docker-compose stop
docker compose stop
```

## Mailpit

UserFrosting's default `docker-compose.yml` file contains a service entry for [Mailpit](https://github.com/axllent/mailpit). Mailpit intercepts emails sent by your application during local development and provides a convenient web interface so that you can preview your email messages in your browser.
UserFrosting's default `compose.yaml` file contains a service entry for [Mailpit](https://github.com/axllent/mailpit). Mailpit intercepts emails sent by your application during local development and provides a convenient web interface so that you can preview your email messages in your browser.

While UserFrosting is running, you may access the Mailpit web interface at: [http://localhost:8025](http://localhost:8025).

Expand All @@ -124,54 +124,54 @@ Every Bakery command needs to be wrapped in Docker Compose syntax, since you nee
For example:

```bash
docker-compose exec app php bakery ...
docker compose exec app php bakery ...
```

## Working with the Containers

If you need to stop the UserFrosting Docker containers, change to your UserFrosting directory and run:

```bash
docker-compose stop
docker compose stop
```

To start the containers again, change to your UserFrosting directory and run:

```bash
docker-compose up -d
docker compose up -d
```

If you need to purge your Docker containers (this will not delete any source files or sprinkles, but will empty the database), run:

```bash
docker-compose down --remove-orphans
docker compose down --remove-orphans
```

And then start the installation process again.

## Advanced configuration

At the heart of everything is the `docker-compose.yml` file. If you're experienced with Docker and Docker Compose, this is where you can customize your Docker experience. For example, you can customize the port each service runs on. Since the file is located in *your sprinkle* (your app), it's possible to save this file in your repository.
At the heart of everything is the `compose.yaml` file. If you're experienced with Docker and Docker Compose, this is where you can customize your Docker experience. For example, you can customize the port each service runs on. Since the file is located in *your sprinkle* (your app), it's possible to save this file in your repository.

The `docker-compose.yml` file also contains the MySQL database and Mail environment variables. Since these variables are defined globally inside the container, they don't need to be redefined inside the `.env` file.
The `compose.yaml` file also contains the MySQL database and Mail environment variables. Since these variables are defined globally inside the container, they don't need to be redefined inside the `.env` file.

> [!WARNING]
> If you have **multiple** instances of UserFrosting on your computer, **they will share the same configuration by default**. This means:
> 1. You can't run multiple Docker instances of UserFrosting *simultaneously* with the default configuration, as ports will conflict.
> 2. Both instances will share the same database.
>
> If you wish to run multiple instances of UserFrosting on the same computer with Docker, you must edit the `docker-compose.yml` for each instance and change the ports and database volumes/database names.
> If you wish to run multiple instances of UserFrosting on the same computer with Docker, you must edit the `compose.yaml` for each instance and change the ports and database volumes/database names.

> [!NOTE]
> An "*address already in use*" error can be thrown if a port defined in `docker-compose.yml` is already used on your system. For example, if Mailpit is installed locally and running on the default port, you'll get an "address already in use" error when running Docker. This can be solved by changing the port in `docker-compose.yml`.
> An "*address already in use*" error can be thrown if a port defined in `compose.yaml` is already used on your system. For example, if Mailpit is installed locally and running on the default port, you'll get an "address already in use" error when running Docker. This can be solved by changing the port in `compose.yaml`.

## Production Environment

**This setup is not (yet) meant for production!**

You may be tempted to use this configuration in production, but it has not been security-hardened. For example:

- The database is exposed on port 8593 so you can access MySQL using your favorite client at `localhost:8593`. However, the way Docker exposes ports bypasses common firewalls like `ufw`. This should not be exposed in production.
- The database is exposed on port 8503 so you can access MySQL using your favorite client at `localhost:8503`. However, the way Docker exposes ports bypasses common firewalls like `ufw`. This should not be exposed in production.
- Database credentials are hard-coded, which is not secure.
- File permissions may be more permissive than necessary.
- HTTPS is not implemented.
Expand Down
4 changes: 2 additions & 2 deletions app/pages/6.0/05.sprinkles/02.content/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ The `storage` directory is used to store files managed by Filesystem service. Th

To separate content and logic, UserFrosting uses the popular [Twig](http://twig.symfony.com/) templating engine. Since Twig has its own system for [loading templates](http://twig.symfony.com/doc/api.html#built-in-loaders), UserFrosting builds upon this to allow overriding templates in sprinkles. See [Templating with Twig](/pages-and-layout) for more information on how Twig is integrated into UserFrosting.

### /app/test
### /app/tests

The `test` directory is similar to `/src`, but for your [Tests](/testing).
The `tests` directory is similar to `/src`, but for your [Tests](/testing).

### /app/.env

Expand Down
17 changes: 17 additions & 0 deletions app/pages/6.0/05.sprinkles/03.recipe/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ The available sub-recipes includes:
| [MiddlewareRecipe](#middlewarerecipe) | Registering [Middlewares](/advanced/middlewares) |
| [EventListenerRecipe](#eventlistenerrecipe) | Registering [Event Listeners](/advanced/events) |
| [TwigExtensionRecipe](#twigextensionrecipe) | Registering [Twig Extension](/pages-and-layout/filters-and-functions#extending-twig-extensions) |
| [MarkdownExtensionRecipe](#markdownextensionrecipe) | Register custom CommonMark extensions |

Your recipe simply needs to implement the corresponding interface. Classes may implement more than one interface if desired by separating each interface with a comma. For example :

Expand Down Expand Up @@ -329,6 +330,22 @@ Methods to implement :
}
```

### MarkdownExtensionRecipe
Interface : `UserFrosting\Sprinkle\Core\Sprinkle\Recipe\MarkdownExtensionRecipe`

Methods to implement :
- `getMarkdownExtensions` : Return a list of custom [CommonMark](https://commonmark.thephpleague.com/) extension classes

**Example:**
```php
public function getMarkdownExtensions(): array
{
return [
MyCustomMarkdownExtension::class,
];
}
```

## Removing default sprinkles

A default install, from the Skeleton, enables every [default sprinkle](/structure/sprinkles#bundled-sprinkles). But your app may not require every feature provided by these default sprinkles. For example, you might not need the Admin sprinkle if you don't need any user management features.
Expand Down
2 changes: 1 addition & 1 deletion app/pages/6.0/05.sprinkles/04.customize/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ $ composer update
```

> [!NOTE]
> If after running these steps, UserFrosting fails to find new classes that you add to `src/`, make sure that that the user running Composer had read permissions for your sprinkle. You can check that the path to your sprinkle's `src/` directory was actually added in `app/vendor/composer/autoload_psr4.php` You can also try running Composer with the `-vvv` flag for more detailed reporting.
> If after running these steps, UserFrosting fails to find new classes that you add to `src/`, make sure that that the user running Composer had read permissions for your sprinkle. You can check that the path to your sprinkle's `src/` directory was actually added in `vendor/composer/autoload_psr4.php` You can also try running Composer with the `-vvv` flag for more detailed reporting.

### The recipe

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ This is where the **dependency injection container (DIC)** comes into play. The
>
> You don't need a container to do dependency injection. However, a container can make injections easier.

UserFrosting uses [_PHP-DI 7_](https://php-di.org) as it's DIC implementation since it provides many powerful features that we rely on:
UserFrosting uses [_PHP-DI 7_](https://php-di.org) as its DIC implementation since it provides many powerful features that we rely on:

1. It creates dependencies lazily ("on demand"). Any service (and its dependencies) won't be created until the first time we access them.
2. Once an object has been created in the container, the same object is returned in each subsequent call to the container.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This service handles the [alert message stream](/advanced/alert-stream), sometim

### `Illuminate\Cache\Repository as Cache`

Creates an instance of a Laravel [Cache](https://laravel.com/docs/8.x/cache). See [Chapter 18](/advanced/caching) for more information.
Creates an instance of a Laravel [Cache](https://laravel.com/docs/10.x/cache). See [Chapter 18](/advanced/caching) for more information.

### `UserFrosting\Config\Config`

Expand Down Expand Up @@ -77,7 +77,7 @@ See [Chapter 7](/routes-and-controllers) for more information about defining rou

### `UserFrosting\Session\Session`

Sets up UserFrosting's `Session` object, which serves as a wrapper for the `$_SESSION` superglobal. `Session` will use file- or database-based storage for sessions, depending on your configuration setting for `session.handler`. Session handlers are provided by [Laravel's session handlers](https://laravel.com/docs/8.x/session#configuration), which implement PHP's [`SessionHandlerInterface`](http://php.net/SessionHandlerInterface).
Sets up UserFrosting's `Session` object, which serves as a wrapper for the `$_SESSION` superglobal. `Session` will use file- or database-based storage for sessions, depending on your configuration setting for `session.handler`. Session handlers are provided by [Laravel's session handlers](https://laravel.com/docs/10.x/session#configuration), which implement PHP's [`SessionHandlerInterface`](http://php.net/SessionHandlerInterface).

Please note that when using file-based sessions, UserFrosting places sessions in its own `/app/sessions` directory instead of PHP's default session directory.

Expand Down
Loading
Loading