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.

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 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

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/contracts Version ^10.0
laravel/forge-sdk Version ^3.13
spatie/laravel-medialibrary Version ^10.0
spatie/laravel-package-tools Version ^1.12
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 mach3builders/laravel-privatelabel contains the following files

Loading the files please wait ....