Download the PHP package devdojo/tails without Composer

On this page you can find all versions of the php package devdojo/tails. 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 tails

Tails Laravel Package

Latest Version on Packagist Total Downloads

Tails Package Image

This package will allow you to easily fetch designs that you have created in the Tails page builder. Follow the steps below to learn how to install, configure, and use this package.

1. Install The Package

You can install the package via composer:

2. Publish the Config

Run the following command to publish the Tails config:

3. Get Your API Key

Visit https://devdojo.com/tails/app and click the Developer API Key button from the menu.

Developer API Key Menu Item

When you click this button it will open up a modal window that looks like the following:

Generate New API Key

Simply, click the Generate My API Key button and you'll be presented with your new API Key.

Tails API Key

If you ever need to re-generate your key, you can click the Re-generate My API Key button and it will be refreshed.

5. Add API key to .env

You will need to add your API key that you got in the previous step to your .env file. It should look something like the following:

6. Test the Connection

We've added a really simple artisan call for you to test out the functionality and confirm that your application is talking to the Tails API. Simply, run the following artisan command.

If you get a response that says pong, you have successfully authenticated and connected to the API.

7. Displaying Designs

We've made it really easy to display the designs you created with tails inside of your application. You can display the page from a specific route or include the design inside an existing blade file. Let's cover displaying the page on a route first.

Displaying the page via a Route

The simplest way is to add a Tails route is to add the following inside of your routes/web.php file:

This will load the design from the homepage of a project called project-name. You can find the project slug for your specific project by clicking on the settings bar at the top of a project.

Tails Settings

This will show you the following modal:

Tails Project Settings Modal

In the example from the image above, the slug you would use is in this case ismy-website, so your route would look like the following:

This doesn't have to map to the homepage, it could map to any route:

Additionally, you can load any page from a specific project by using dot notation, like so:

The code above 👆 will fetch the design from an about page inside the my-website project and load it up from your application at the /about route 🤙 Easy peasy, like Mac & Cheesy!

Display the Design in an Existing File

Next, you may want to include a specific design inside of an existing blade file. You can easily accomplish this with the following syntax:

Using dot notation, you can also load the design for a specific page:

By default the @tails directive will only return the content inside the <body> of the design. If you wish to fetch the full HTML of the page you can specify it after the : symbol, like so:

Using the @tails directive you can retrieve all the information about a specific page using : notation. Here is an example structure of the API response:

You can retrieve all this information using the @tails directive like so:

Here is an example of how you would display a page with the minified styles and the HTML body conent:

8. Enable the Webhook

By default all the requests that are made to fetch designs from the Tails API is cached on your applications end. This means that when a user visits your website or application it doesn't have to talk to the Tails API, resulting in faster page loads. Unfortunately since it's cached, your application needs to know when a new version of this page has been updated and show the updated version to your users. You can easiily solve this by enabling the webhook.

Enabling Webhook and setting your Webhook URL

In the project settings modal there is a tab on the left called Webhook, on this tab you will need to turn on the webhook and enter in your webhook URL:

Webhook

Your webhook URL is going to be your-website.com/tails/webhook, this route /tails/webhook, has already been added in this package. All you have to do is enter the URL inside of the textarea.

Note: If you need to change the tails webhook URL set the TAILS_WEBHOOK_URL env. This will change /tails/webhook to whatever you want.

Adding the Webhook Key to your .env

In the Webhook modal you will also see another input labeled Webhook Key, you will need to copy this value and paste it into your .env file like so:

This is a security measure, it will gaurentee that the Tails application is the only application sending requests to that endpoint. After you've added this key to your environment file and updated the correct URL in the Webhook modal, you should be all set.

Each time you are working in the Tails application and a page is saved, it will send a webhook to your application telling it which pages need to be cleared from the cache, this way the new version will be served up the next time someone visits that page.

Note: If you are working on an app from your local machine, you will need to make sure it is accessible from a live URL. You can use tools like Expose or Ngrok to create a live URL of your local website. They both have some free options that will work for testing your webhook functionality. BTW, using the https:// version instead of the http:// version will work better.

9. 🍻 That's it

That's the basics on how to setup this package and use with Tails.

Thanks for using Tails and feel free to reach out to us on Twitter with any issues or recommendations and we'll try and get back to you in an appropriate time frame. Thanks again for using our products. You rock 🤘

🗑 Removing Cached Files

You can use the Webhook to automatically clear cached pages and show the most up-to-date version; however, you can manually clear these cached files by running the following command:

Now, when you view a page that calls the Tails API, you will get a new version of that page.

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

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

Laravel Package Boilerplate

This package was generated using the Laravel Package Boilerplate.


All versions of tails with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.0|^8.1|^8.2
illuminate/support Version ^8.0|^9.0|^10.0|^11.0
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 devdojo/tails contains the following files

Loading the files please wait ....