Upgrading to v2 from 1.x
This upgrade guide only discusses upgrading Socialstream 2.x and assumes you are upgrading from an unaltered 1.x install. Upgrading Jetstream, Livewire, Inertia, Vue or Tailwind CSS is out of scope for this documentation. Please consult the upgrade guides for each of these packages instead.
Overview
Changes
Connected Account Details
Impact: High
Version 2.x of Socialstream now captures more user data from a provider and saves them to your connected_accounts
table. In order to correctly save this data, you will need to create a new migration to make the appropriate changes.
To do this, you should create a new connected_accounts
migration:
The geneated migration should contain the following code:
Current Connected Account Context
Impact: High
When you login using a social provider, Socialstream will now set the context for the most-recent, or "current" provider being used. To do this, a new current_connected_account_id
column will need adding to your users table.
Generate a new users
migration:
The migration should be popuplated with the following content:
Create Connected Account Action
Impact: High
Socialstream 2.x adds a new action for creating connected accounts on registration with a provider. You should copy the new CreateConnectedAccount action to the App/Actions/Socialstream
directory in your project.
You should then add the register the action with Socialstream by placing the following code into the boot
method of your application's SocialstreamServiceProvider
:
Generate Provider Redirect Action
Impact: High
Socialstream 2.x includes a new action to generate the redirects URI's used to authenticate with providers.
You should then register this action with Socialstream by placing the following code into the boot
method of your application's SocialstreamServiceProvider
:
If you wish, you may override this action by writing your own. This may allow you to define scopes
or additional parameters, such as a response_type
for explicit grants. See below for an example.
Note: the action MUST implement the
JoelButcher\Socialstream\Contracts\GeneratesProviderRedirect
contract.
Connected Account Credentials
Impact: Low
For convenience, Socialstream now also provides a Credentials
helper class which can be used for authenticating with additional provider API's (e.g. Facebook's Graph API).
You may retrieve an instance of this class from a connected account:
Inertia Stack
Authentication Views
To upgrade your application's authentication views to use the new Vue files from Jetstream 2.x, you should copy the Jetstream auth files, then the Socialstream auth files to the resources/js/Pages/Auth
folder location.
You will also need to copy the Providers.vue file to the resources/js/Socialstream
directory.
However, if you wish to continue to render the Blade based authentication views, you should add the following code to the boot
method of your application's JetstreamServiceProvider
class:
Last updated