Download the PHP package caouecs/sirtrevorjs without Composer

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

Laravel-SirTrevorJS

Quality Gate Status

Integrate the tool Sir Trevor JS in a Laravel 5/6/7/8/9 project.

Installation

This package is available through Packagist and Composer.

For PHP 8 version, use the branch master : "caouecs/sirtrevorjs": "~4.1.0"

For PHP 7 version, use the branch v3.0 : "caouecs/sirtrevorjs": "~3.0.0"

For Laravel >= 5.2 version parser, use the branch v2.5 : "caouecs/sirtrevorjs": "~2.5.0"

For Laravel >= 5.1 version js & amp, use the branch v2.4 : "caouecs/sirtrevorjs": "~2.4.0"

For Laravel >= 5.1 version fb articles, use the branch v2.3 : "caouecs/sirtrevorjs": "~2.3.0"

For Laravel >= 5.1 version view & amp, use the branch v2.2 : "caouecs/sirtrevorjs": "~2.2.0"

For Laravel >= 5.1 version base, use the branch v2.1 : "caouecs/sirtrevorjs": "~2.1.0"

For Laravel 5.0, use the branch v2 : "caouecs/sirtrevorjs": "~2.0.0"

For Laravel 4, use the branch laravel4 : "caouecs/sirtrevorjs": "~1.4"

Please read README.md in the choosen branch.

Service Provider

If you want to use routing, controllers, views, binding directly in your project, in your app/config/app.php, add "Caouecs\Sirtrevorjs\SirtrevorjsServiceProvider" to your list of providers.

Twitter

To get tweets, this project uses thujohn/twitter. Please visit the page of the project to know how to install and configure.

Configuration file

Next, you must migrate config :

php artisan vendor:publish caouecs/sirtrevorjs

After installation, the config file is located at app/config/packages/caouecs/sirtrevorjs/sir-trevor-js.php.

You can define :

SirTrevorJs class

Assets

For stylesheets :

For scripts, in your Blade files :

Fix for image block

Function to fix a problem with image block when you add a new image :

Find first image

Get first image in text with findImage method :

In return, you have url of image or empty string.

Find elements by blocktypes

Get all elements in text, in specified blocktype with find method :

In return, you can have :

Controller

SirTrevorJsable

This trait proposes two things :

Upload image

This project proposes a system for upload image, nothing to configure, just the directory_upload value in config file.

Tweet

This project proposes a system to get tweets. I use thujohn/twitter project.

SirTrevorJsConverter class

This class need a parser, a configuration and a view by default.

You can use the binding of this class :

Html

Convert text from Sir Trevor Js to html :

These methods return a string with html and js codes.

Amp

Convert text from Sir Trevor Js to Amp:

All modules have an amp's version, if it exists an equivalence.

This method returns an array ( text and js).

Facebook Instant Articles

Convert text from Sir Trevor Js to Facebook Instant Articles:

All modules have an FBArticles's version, if it exists an equivalence.

This method returns a string with html and js codes.

Adding custom blocks

You can choose to add custom blocks in config file or add them by extending SirTrevorJsConverter class.

config

SirTrevorConverter

And you need to call this class in your service provider, in register :

$this->app->bind('editor.converter', function ($app) {
    return new App\SirTrevorConverters\SirTrevorJsConverterEditor(
        new LaravelParser(),
        config('sir-trevor-js'),
        'html'
    );
});

Modules

For the moment, the code can convert :


All versions of sirtrevorjs with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
illuminate/support Version ~9.0|~10.0
laravelcollective/html Version ~6.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 caouecs/sirtrevorjs contains the following files

Loading the files please wait ....