Download the PHP package marshmallow/helpers without Composer

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

alt text

Marshmallow Deployer

We have build a package with some helpers that are usefull in almost every project. We use this package in all our projects. For ourself and for our customers. If you miss anything, create an issue and will will add it as soon as possible.

Version Issues Code Coverage Licence

Installation

You can install the package via composer:

Table of contents

  1. CSV Helper
  2. Helper functions
  3. String helper
  4. Migrations
  5. URL
  6. Array
  7. Reviews
  8. Grouper

CSV Helper

This helper will make generating .csv files extremly ease. Please check the examples below. You can use the store method to store it in a location of your choosing. You can use the download method if you just want to download the file. If you wish to store and download the generated .csv file you can use the storeAndDownload method.

Usage example

Use a collection as data attribute

You can use a collection as your data attribute. By default it will map all the data in the collection sequence. If you wish to edit the collection data, you can add a callback method to the data method. Please note that this will give you every row as an array value.

Store and download calls

The following methods are available for storing and downloading the generated csv file.

Helper functions

Percentage helper

This is a public helper function that is available within your Laravel application. This function can be used in all your PHP and Blade files.

String Helper

The Str helper extends the helper from Laravel. So you have all the methods available in the Laravel helper available as well. Check the Laravel documentation for all the available methods.

Str::join()

This method is super handy for concatenating strings separated by a comma, but use another value for the last item. Checkout the example below.

Str::random()

We have added on the default Str::random() of Laravel. We've added a second parameter which is an array of characters that should be ignored. We also have build in a couple of presets like lowercase which will make sure the random string won't contain any lowercase characters.

Str::cleanPhoneNumber()

Str::phonenumberWithCountryCode()

Return a cleaned phonenumber with the country code. You can choose to return the phonenumber with a + or 00 at the start of the phonenumber.

Str::numbersOnly()

Str::numbersAndLettersOnly()

Str::readmore()

Str::paragraphsAsArray()

Str::getFirstParagraph()

Str::getAllButFirstParagraph()

Migrations

We have a trait available that gives you some extra options when creating migrations. Add the MigrationHelper trait to you migration to make use of these options.

Implementation

Create a column only if it doesn't exist.

This method was added because when a database that already has a products table and later will use our Product package, the migrations will through error's.

URL

URL::isInternal()

URL::isCurrent()

URL::buildFromArray()

URL::isNova()

URL::isNotNova()

Array

Arrayable::storeInFile();

This method will store a pretty array in a file. With this method is possible to generate config files.

Builder

Builder::published()

BuilderHelper::published will filter on database columns if something is published.

Reviews

For the review stars you can call ReviewHelper::ratingToStars(4.5). By default the ReviewHelper will think you are using a max rating of 5, support half star rating and return a string of FontAwesome icons. You can overule this behaviour by;

Customise

Create the config file config/review.php and specify your needs:

Or you can provide the same config array as a second parameter to the ratingToStars method like so;

Grouper

Grouper is a super handy helper when you need to split your queries results in to groups. We use this with blogs a lot. The first row might have 3 results, the second row will have 1 result, en the third row will have 3 items again. Please see the example below.

As you can see in the example, the structure_array has a name as the key. This is done so when you are looping through your groups, you are able the test which group you are currently looping.

Looping through the group items works just like you expect when working with collections.

Changelog

Please see CHANGELOG for more information what has changed recently.

Testing

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.


All versions of helpers with dependencies

PHP Build Version
Package Version
Requires php Version ^7.0|^8.0
laravel/helpers Version ^1.3
illuminate/database Version ^8.0|^9.0|^10.0|^11.0
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 marshmallow/helpers contains the following files

Loading the files please wait ....