Download the PHP package sukohi/coaster without Composer

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

Coaster

A PHP package mainly developed for Laravel to make array for Form::select() with/without a placeholder.
(This is for Laravel 5+. For Laravel 4.2)

Installation

Add this package name in composer.json

"require": {
  "sukohi/coaster": "2.*"
}

Execute composer command.

composer update

Register the service provider in app.php

'providers' => [
    ...Others...,  
    Sukohi\Coaster\CoasterServiceProvider::class,
]

Also alias

'aliases' => [
    ...Others...,  
    'Coaster'   => Sukohi\Coaster\Facades\Coaster::class
]

Usage

Minimal Way

$lists = \Coaster::get([
    '1' => 'Text - 1',
    '2' => 'Text - 2',
    '3' => 'Text - 3',
], 'Please choose');
echo Form::select('test1', $lists);

/* Output

    <select name="test1">
        <option value="" selected="selected">Please choose</option>
        <option value="0">Text - 1</option>
        <option value="1">Text - 2</option>
        <option value="2">Text - 3</option>
    </select>

*/

with Displaying Flag (If $placeholder_flag is false, the placeholder will not be displayed)

$lists = \Coaster::get([
    '1' => 'Text - 1',
    '2' => 'Text - 2',
    '3' => 'Text - 3',
], 'Please choose', $placeholder_flag = true);
echo Form::select('test2', $lists);

/* Output

    <select name="test2">
        <option value="" selected="selected">Please choose</option>
        <option value="0">Text - 1</option>
        <option value="1">Text - 2</option>
        <option value="2">Text - 3</option>
    </select>

*/

Using Closure

$lists = \Coaster::get(function(){

    return \App\User::where('id', '<', 5)->lists('name', 'id')->all();    // You need to return array values.

}, 'Please choose');
echo Form::select('test3', $lists);

/* Output

    <select name="test3">
        <option value="" selected="selected">Please choose</option>
        <option value="0">title - 0</option>
        <option value="1">title - 1</option>
        <option value="2">title - 2</option>
        <option value="3">title - 3</option>
    </select>

*/

with Default Value

$lists = \Coaster::get([
    '1' => 'Text - 1',
    '2' => 'Text - 2',
    '3' => 'Text - 3',
], ['default' => 'Please choose'], true);
echo Form::select('test4', $lists);

/* Output

<select name="test4">
    <option value="default">Please choose</option>
    <option value="0">Text - 1</option>
    <option value="1">Text - 2</option>
    <option value="2">Text - 3</option>
</select>

*/

License

This package is licensed under the MIT License.

Copyright 2015 Sukohi Kuhoh


All versions of coaster with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
illuminate/support Version 4.2.*
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 sukohi/coaster contains the following files

Loading the files please wait ....