Download the PHP package lbausch/flarum-laravel-session without Composer

On this page you can find all versions of the php package lbausch/flarum-laravel-session. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package flarum-laravel-session

Flarum Laravel Session

tests codecov

What It Does

This package allows to use the session of Flarum for authentication within a Laravel application. It accesses Flarum's session cookie and reads the session data from the session storage. Based on the user information in the Flarum user database an user in the Laravel application is created / updated and logged in.

Requirements

Installation and Configuration

Composer

Install the package with Composer:

Register Middleware

Register the \Bausch\FlarumLaravelSession\FlarumSessionMiddleware middleware in app/Http/Kernel.php:

Setup Database Connection

Define a database connection for the Flarum database in config/database.php:

Publish Package Configuration

Publish the package configuration using php artisan vendor:publish --provider=Bausch\\FlarumLaravelSession\\ServiceProvider and update config/flarum.php with your settings.

Disable Cookie Encryption

To avoid Laravel from trying to encrypt the Flarum session cookie, add the following to app/Http/Middleware/EncryptCookies.php:

Usage

Setup Middleware

In routes/web.php you may assign the middleware as desired:

All requests to the / route will then be checked by the middleware.

Handle An Identified User

Once the middleware successfully identified an user, it executes the default handler \Bausch\FlarumLaravelSession\Actions\HandleIdentifiedUser. You may configure a different handler by calling FlarumLaravelSession::handleIdentifiedUser() in a service provider. This is a perfect place to update attributes or execute further actions, just remember to implement the \Bausch\FlarumLaravelSession\Contracts\FlarumUserIdentified interface. Have a look at the default handler for a reference implementation.

If you need to use a different user model than App\Models\User, you may call FlarumLaravelSession::useUserModel(YourUser::class) in your service provider.

Accessing Flarum Session Cookie From Different Domain

If Flarum is running on domain.tld and Laravel on sub.domain.tld you need to configure Flarum (config.php), so the session cookie can be accessed on the subdomain:


All versions of flarum-laravel-session with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/auth Version ^10.0
illuminate/filesystem Version ^10.0
illuminate/http Version ^10.0
illuminate/session Version ^10.0
illuminate/support Version ^10.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package lbausch/flarum-laravel-session contains the following files

Loading the files please wait ....