Installation
This page will walk you through how to get Socialstream up and running in a new Laravel application using Laravel Jetstream with Livewire 3. This example will use GitHub as the social provider.
Socialstream is designed to work in tandem with either of Laravel's starter kits (Breeze and Jetstream) and Filament Admin Panel, and as such, Socialstream should be installed into a NEW Laravel applications only. It is not recommended to install Socialstream into an existing application.
Example Installation
To install Socialstream into your application you may use composer
, you will then need to execute the install
artisan command:
The install command will walk you through a bunch of options, such as the starter kit, for this example, choose Laravel Jetstream
:
Next, we will need to choose the technology stack we wish to use, choose Livewire
.
Next, select the optional features you wish to include with your application. In this example, we've decided we want to use Jetstreams Dark mode
and Team
features.
And finally, we have the option of selecting the testing framework we wish to use when building our application. Feel free to make your own decision at this step. In this example, I've chosen Pest
, the best testing framework for PHP and Laravel.
Once you've done this, Socialstream will install all the required dependencies for the options you've selected, including pulling in and installing Laravel Jetstream for you โ no need to composer require
another package manually yourself!
You can test the installation by running php artisan serve
and visiting your application at http://127.0.0.1:8000
:
You'll notice that if you click on Log in
or Register
links at the top of the page that Socialstream isn't loaded, this is because we have a few things to configure before we can use Socialstream.
Firstly, we need to configure our OAuth provider. In this example, we will be using GitHub, head on over to GitHub and go to your profiles developer settings and create a new OAuth app:
When you have done this, you will be presented with your applications Client ID, make a note of this for later.
Next, click the Generate a new client secret
button just under the Client ID. GitHub may prompt you to confirm this action via a 2FA prompt. Make a note of the Client Secret for later.
Configuring the Github Provider
Now that we have our OAuth provider configured, we need to enable the provider in our application. Add the following code snippet to your applications socialstream.php
config file:
You may change the text that appears on each providers button, by specifying a label
in each provider: Provider::github(label: 'My Provider')
.
Now, when you navigate to your applications /register
route, you will now see the Login via GitHub
option:
Configure Client Credentials
The last thing to do, is configure the client credentials in your application. Add the following to your applications services.php
config file:
You may add a prefix to your applications Socialstream routes by specifying a prefix
option in your socialstream
config file:
This is especially helpful if you plan to use Laravel Passport, which also defines /oauth
routes.
Configure Socialstream Features
You may specify the socialstream features you wish for your app to support in the features
array. A number are already added for you, with some commented out by default.
The providerAvatars
feature requires the profilePhotos
Jetstream feature to be enabled for it to take affect.
Installation Options
Socialstream supports a number of installation options depending on the starter kit (and stack) you choose to install. With each starter kit and stack, Socialstream will install all the required dependencies for each one.
Laravel Jetstream
Socialstream supports Laravel Jetstream with Vue (Inertia) or Livewire 3.0, with the following options:
--dark
โ dark mode support--api
โ allows users to manage API tokens (distrubuted via Laravel Sanctum)--verification
โ user email verification--teams
โ Jetstreams team management features--pest
โ support for the best testing library for Laravel, Pest PHP--ssr
โ server side rendering (Vue with Inertia only)
Laravel Breeze
Socialstream supports all of Laravel Breeze's stack options; including the new Volt Class and Functional API's.
The following options are available for Laravel Breeze:
--dark
โ dark mode support--pest
โ support for the best testing library for Laravel, Pest PHP--ssr
โ server side rendering (Vue and React with Inertia only)--typescript
โ typescript support (Vue and React with Inertia only)
Filament Admin Panels
Socialstream supports Filament Admin Panels, for admin login and registration (if enabled). It does this via a plugin extension for the AdminPanelProvider
. It appends the socialstream::components.socialstream
component to the bottom of both forms:
If you wish to change the layout of the views for filament, you may publish Socialstream components using the vendor:publish
artisan command:
Last updated