Download the PHP package saasykit/laravel-open-graphy without Composer

On this page you can find all versions of the php package saasykit/laravel-open-graphy. 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-open-graphy

Build Status

Open Graphy is an awesome open graph image (social / twitter / X cards) generator package for your Laravel applications.

With Open Graphy, you can generate social cards for your website dynamically. You can use the default template or create your own template.

Features:

Examples: 👇

Requirements

Installation

  1. You need to install the chromium or chrome browser on your server as it's being used by Open Graphy to render images.

Ubuntu/Debian:

Note for Ubuntu ARM systems:

Sometimes Ubuntu systems that are based on ARM might have problems with snap packages (like chromium), and because of that chromium might not work via the web server. In this case you can try setting the generate_with_command option to true in the config file. This will generate the open graph image with a command instead from the controller.

MacOS:

Laravel Sail using MacOS (Apple Silicon): I found the following steps to work for me on my M1 Macbook Pro:

  1. Once done, You can install the package via composer:

You can publish the config file with:

This is the contents of the published config file:

Configuration options:

The configs above allow you to edit the colors and styling of the provided templates, but if you prefer to go god mode and edit styles or introduce new templates, you can publish the views using the following command:

See below for Creating a custom template for more details.

Usage

All what you need to do is to call the following component in your <head> tag in your blade file:

This component accepts the following parameters:

Calling the x-open-graphy::links component will generate the following meta tags in your HTML:

Figuring out your best design:

Open Graphy comes with a testing route (only available for local environment) that you can use to test the different templates and settings. You can access the route by visiting /open-graphy/test in your browser.

It accepts the following query parameters:

You would typically need to edit the settings in the config file to change the colors and styles of the templates, and keep testing until you find the best design for your website.

Website Screenshots:

You can also add a screenshot of the page to the open graph image. This is useful if you want to show a preview of the page in the open graph image. To enable this feature, set the screenshot.enabled to true in the config file.

Example:

Important 1: this feature works only if the page is accessible from the internet where the package is installed. What happens is that the package will open the page in a headless browser, take a screenshot of the page and add it to the open graph image. This will NOT work on a Laravel sail installation unless do you do some magic.

Important 2: most of the time screenshotting works fine, but sometimes longer pages or ones that have more heavy effects will timout. You can increase the render_timeout in the config file to allow more time for the screenshot to render, but Open Graphy will fail gracefully if the screenshot could not be taken, and will still generate the open graph image without the screenshot.

Clearing the cache:

You can clear the cache of the generated images using the following command:

Creating a custom template:

To create a custom template, you need to publish the views (if you haven't already) using the following command:

Now you can create a new blade file in the resources/views/vendor/open-graphy/templates directory. The file should contain the HTML and CSS for the template. You can get some inspiration from the existing templates in the package.

Once you have created the template, you can set the template key in the config file to the name of the template file (without the .blade.php extension). For example, if you created a file called custom.blade.php, you would set the template key to custom.

You can use the following pattern library if you're looking for cool ones: https://www.svgbackgrounds.com/set/free-svg-backgrounds-and-patterns/

Wanna build a Laravel SaaS application quickly?

If you want to build a SaaS app quickly, support us by checking out SaaSykit. It's a SaaS starter kit (boilerplate) that comes packed with all components required to run a modern SaaS software.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

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

Credits

License

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


All versions of laravel-open-graphy with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
chrome-php/chrome Version ^1.11
illuminate/contracts Version ^10.0||^11.0
spatie/laravel-package-tools Version ^1.16
ext-fileinfo Version *
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 saasykit/laravel-open-graphy contains the following files

Loading the files please wait ....