Download the PHP package mach3builders/laravel-privatelabel without Composer
On this page you can find all versions of the php package mach3builders/laravel-privatelabel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mach3builders/laravel-privatelabel
More information about mach3builders/laravel-privatelabel
Files in mach3builders/laravel-privatelabel
Package laravel-privatelabel
Short Description Add private label functionality to mach3laravel applications
License MIT
Homepage https://github.com/mach3builders/laravel-privatelabel
Informations about the package laravel-privatelabel
Add private label functionality to mach3laravel applications
This package is designed for the laravel-starter
. It presupposes that your project was initiated using the laravel-starter
template.
Installation
Install the package via composer:
Publish and execute migrations:
Publish the configuration file:
Here's the published configuration file:
Add the following variables to your .env file:
Migrate the database
Usage
Navigation
Include the index route in your menu:
PHP
Incorporate this trait into your owner model as specified in the config:
JavaScript
Insert this snippet into your app.js
:
Brand Customization
To easily manage brand-specific elements like logos and favicons, use this Brand.php
template:
Label API
The label()
helper is provided by this package. Here are the methods and properties you can access:
Properties
Events
The email page gives the user the possibility to add a email to their private label. The domain of that email then gets added to the mailgun account of m3b. The user then has the ability to verify that this domain has been added and is verified.
After the domain has been verified the EmailDomainVerified
event gets dispatched. See the following example on how to listen to this event.
Authorization
Use the viewPrivateLabel
gate for secure access. Add this to your AuthServiceProvider.php
:
Methods
The following method returns the owner of the private label. This corresponds with the owner model set in the config
Since laravel-privatelabel uses spatie/medialibary all the methods are available.
The following collections are defined inside the PrivateLabel
model
Commands
The packages comes with 2 commands, one to update all php versions of the private labels and one to reinstall all private labels on the forge server.
Reinstall labels
the following command will reinstall all private labels on the forge server. The private label will be updated to status dns_validating
and will go trough the process of being installed on the server.
To reinstall all labels use:
To reinstall a specific label use:
Update label php versions
The following command will update all the php versions of the private labels. The php version will be updated to the latest version available on the forge server. Or to the version specified in the prompts asked to the user when running the command
Testing
Code styling
All code should be styled using the following command:
Installing Caddy on the server
The private label will rely on caddy to handle the ssl. The main app will also need to be running on port 8080.
To make the main app run on 8080, change the nginx of the main app to listen on 8080. Change this in the ngin config, this can be done trough forge >> site >> >> edit files >> edit nginx
New way
Default way for https
Default way for http
Also comment out the first line of the nginx config
Then ssh into the server and remove the 000-catch-all symlink in /etc/nginx/sites-enabled
Restart the nginx service trough forge, or with the following command
To check if the app now runs on 8080 run the following command
You will see all the ports listening on the server, check for
TCP *:8080 (LISTEN)
This is good!
TCP *:80 (LISTEN)
This is bad...
If you still see :80, then check all the above again.
Next step is to install Caddy on the server
Follow https://caddyserver.com/docs/install#debian-ubuntu-raspbian
After this overwrite the Caddyfile at /etc/caddy/Caddyfile
with the following content
Small note, the allowed-domains
endpoint should return a 200 if the domain is allowed.
The allowed domains endpoint receives a domain
GET parameter.
Test the code
Example code
Trouble Shooting Caddy
When some SSL's can not be generated for certain domains, you can do this:
All versions of laravel-privatelabel with dependencies
illuminate/contracts Version ^10.0
laravel/forge-sdk Version ^3.13
spatie/laravel-medialibrary Version ^10.0
spatie/laravel-package-tools Version ^1.12