Install a pre-configured version

This page explains how to easily create a new Uccello project.

1. Create the project

It is possible to start a new Uccello project very simply from the following command:

composer create-project --prefer-dist uccello/project ProjectName

Replace ProjectNamewith the name of your project or by . to install Uccello in the current directory.

This command will close the project's Git repository and automatically install all necessary dependencies. This will create a new Laravel project in which Uccello has been pre-configured.

2. Configure the environment

Once the project is created you can configure the .env file as explained in Laravel's official documentation.

.env
APP_URL=http://localhost:8000
...
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=uccello
DB_USERNAME=homestead
DB_PASSWORD=secret

This is an example. Put your own data into the .env file.

If you do not want to use the notion of multi domains, you can add the following line into the .env file:

.env
...
UCCELLO_MULTI_DOMAINS=false

3. Execute migrations

Once the database is configured, it is now possible to execute migrations to create the database structure used by Uccello.

php artisan migrate

4. Create an user

To easily create a new user, execute the following command:

php artisan uccello:user

5. Activate connection log

You can see last connections of a user in his detail page. To activate this functionality edit the file located at app/Http/Controllers/Auth/LoginController.php and the following code:

use Carbon\Carbon;
use Uccello\Core\Models\Connection;

class LoginController extends Controller
{
  // ...
  
  /**
    * The user has been authenticated.
    *
    * @param  \Illuminate\Http\Request  $request
    * @param  mixed  $user
    * @return mixed
    */
    protected function authenticated(Request $request, $user)
    {
        Connection::create([
            'user_id' => $user->id,
            'datetime' => Carbon::now(),
        ]);
    }
}

6. It's ready!

If you would like to use PHP's built-in development server to serve your application, this command will start a local development server:

php artisan serve

Now you can go to the home page of your site: http://localhost:8000. Once redirected to the login page, you can authenticate yourself with the credentials created at the step 4.

Last updated