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 SSL.
The main app will also need to be running on port 8080.
To make the main app run on 8080, change the Nginx configuration of the main app. This can be done through Forge → Site → Edit Files → Edit Nginx.
New configuration:
Default HTTPS configuration:
Default HTTP configuration:
Also comment out the first line of the Nginx config.
Then SSH into the server and remove the 000-catch-all symlink from /etc/nginx/sites-enabled:
If present, also disable the default Nginx site so it no longer listens on port 80:
If you are using Forge, remove the generated ssl_redirect.conf for the site. Caddy already handles the HTTP → HTTPS redirect, so this configuration is no longer needed. Either remove it or rename it:
Restart Nginx:
Verify that there are no remaining listen 80 directives:
Check the listening ports:
Expected result:
TCP *:8080 (LISTEN)✅ NginxTCP *:80 (LISTEN)❌ Nginx should not be listening here
If Nginx is still listening on port 80, check for any remaining listen 80 directives before continuing.
Laravel configuration
Since Caddy terminates SSL, Laravel must trust the proxy and generate HTTPS URLs.
In bootstrap/app.php:
In AppServiceProvider:
All versions of laravel-privatelabel with dependencies
illuminate/contracts Version ^10.0|^11.0|^12.0
laravel/forge-sdk Version ^3.13
spatie/laravel-medialibrary Version ^11.0
spatie/laravel-package-tools Version ^1.12