Download the PHP package spatie/laravel-support-form without Composer

On this page you can find all versions of the php package spatie/laravel-support-form. 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-support-form

A non-intrusive support bubble that can be displayed on any page

Latest Version on Packagist Total Downloads

Using this package you can quickly add a chat bubble that opens a support form on any page. It comes with batteries included:

You can see it in action below, on Flare and Oh Dear!

support-small

Support us

We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.

Are you a visual learner?

In this stream on YouTube, you'll see how to install that package, and how it works under the hood.

Installation

You can install the package via composer:

Include TailwindCSS

The views included in this package all use TailwindCSS classes. We've stuck to the default Tailwind config classes. If you're not already using TailwindCSS, you can easily include it from their CDN:

If you use Tailwind Just-in-Time Mode you should add these additional lines into your tailwind.config.js file:

This way Tailwind JIT will build your styles including those properties used for the support bubble.

Add the component to your view

After installing the package, you need to add this Blade component in your relevant view files:

If you want it to show up on all pages you can add it to your layout.blade.php file.

Next, you need to register the support form's route. Add the following macro in your routes/api.php file:

This will register a route at /support-bubble

⚠️ This package is not using CSRF tokens so make sure you add the route macro to your apps API routes or add an exclusion in the VerifyCsrfToken middleware.

Configure message destination

Finally, you need to decide where you want to send the support bubble's submission to.

Out of the box, the package can mail the submissions to a given email address. To go this route, publish the config file and enter the email in mail_to.

Alternately, you can register an event listener to listen for the Spatie\SupportBubble\Events\SupportBubbleSubmittedEvent event and handle it yourself. This event has submitted form values as public properties.

The config file can be published with:

These are the default contents of the published config file:

Customization options

The support bubble should look pretty good out of the box. However, we've documented a couple ways to customize labels, text, views and functionality.

Customizing form fields

It is currently not possible to add new fields to the support bubble's form. You can however disable any fields you do not like in the config file.

Customizing text / localisation

If you're just looking to customize the field labels, intro text or success text (after the form submitted), you can publish the package's language files:

These published files can be found and changed in resources/lang/vendor/laravel-support-bubble/en/.

Customizing styles

You can customize the TailwindCSS classes used for the bubble pop-up, input fields and submit button by changing the support-bubble.class config keys. This is the ideal place to change the bubble's default purple color or use your own .input or .button classes.

If you're looking to change any more advanced styles, keep reading to learn how to publish and customize the Blade views used in the support bubble component.

Customizing views

You can publish and change all views (including the JavaScript code) in this package:

These published views can be found and changed in resources/views/vendor/laravel-support-bubble/.

Please keep in mind that it's not possible (or at least pretty difficult and convoluted) to add new fields to the support bubble.

Customizing support form destination

If you don't want to send the support messages to the mail_to email configured in the config file, you can define your own event listener and listen for the Spatie\SupportBubble\Events\SupportBubbleSubmittedEvent. The event contains all data submitted in the support form and can be used to, for example, make an API request to Freshdesk.

Customizing behaviour after submitting (advanced)

If you really want to, you can send the submitted form data to your own endpoint. The support form uses the route configured in the support-bubble.form_action_route config key. You can override this route by removing the Route::supportBubble() macro from your routes file and setting the form_action_route to any other route name in your application.

The incoming request on this route will be a \Spatie\SupportBubble\Http\Requests\SupportBubbleRequest.

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

Alternatives

If you need more options for your support bubble, consider using one of these:

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-support-form with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
illuminate/contracts Version ^8.56|^9.0|^10.0|^11.0
spatie/laravel-honeypot Version ^4.0
spatie/laravel-package-tools Version ^1.9
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 spatie/laravel-support-form contains the following files

Loading the files please wait ....