2017 © Pedro Peláez
 

library laravel

Makes form building and model binding a breeze.

image

typerocket/laravel

Makes form building and model binding a breeze.

  • Thursday, July 12, 2018
  • by kevindees
  • Repository
  • 3 Watchers
  • 7 Stars
  • 1,343 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 54 Versions
  • 15 % Grown

The README.md

TypeRocket for Laravel 5.3

Originally for WordPress, TypeRocket makes building advanced forms and fields easy for Laravel too., (*1)

See http://typerocket.com for documentation (mainly for WordPress)., (*2)

Installing

composer require typerocket/laravel

Laravel Service Providers make a way for extending Laravel. TypeRocket Laravel 2.0 is a service provider for Laravel. In your config/app.php file add:, (*3)

'providers' => [
    // Other Service Providers

    TypeRocket\Service::class,
],

Then form the command line:, (*4)

php artisan vendor:publish --provider="TypeRocket\Service"

You can now access the config/typerocket.php., (*5)

Finally, add uploads to public folder. From your site root directory run:, (*6)

ln -s ../storage/uploads uploads

Note: Routes, views, and controller will be adding for you., (*7)

JS and CSS init

In blade templates such master templates., (*8)

{!! \TypeRocket\Assets::getHeadString() !!}
{!! \TypeRocket\Assets::getFooterString() !!}

Adding assets

$paths = Config::getPaths();

// type ( js || css), id, path
Assets::addToFooter('js', 'typerocket-core', $paths['urls']['js'] . '/typerocket.js');
Assets::addToHead('js', 'typerocket-global', $paths['urls']['js'] . '/global.js');

Forms

// model, action ( create || update ), id, path
$form = new \TypeRocket\Form('Post', 'update', $id, '/posts/' . $id);
<div class="typerocket-container">
    {!! $form->open() !!}
    {!! $form->text('title')->setLabel('Post Title') !!}
    {!! $form->checkbox('publish')->setText('Published') !!}
    {!! $form->close('Submit') !!}
</div>

Request Old Input

To load old input into the form set the request., (*9)

class PostController extends Controller
{
    public function create(Request $request)
    {
        $form = new \TypeRocket\Form('Post', 'create', null, '/posts/');
        $form->setRequest($request); // set request
        return view('posts.create', ['form' => $form]);
    }
}

Validate

class PostController extends Controller
{

    public function store(Request $request)
    {
        $tr = $request->input('tr');

        $validator = \Validator::make($tr, [
            'title' => 'required|max:255'
        ]);

        if ($validator->fails()) {
            return redirect("posts/create")
                ->withErrors($validator)
                ->withInput();
        }

        $post = new Fabric();
        $post->title = $tr['title'];
        $post->save();

        header('Location: /posts/');
    }

}

Matrix route.

Working with matrix fields the service provider will add this for you., (*10)

Route::post('matrix_api/{group}/{type}', function($group, $type) {
    (new TypeRocket\Matrix())->route($group, $type);
});

CSFR for matrix

<?php

namespace App\Http\Middleware;

use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;

class VerifyCsrfToken extends BaseVerifier
{
    /**
     * The URIs that should be excluded from CSRF verification.
     *
     * @var array
     */
    protected $except = [
        'matrix_api/*' // added
    ];
}

Matrix Assets

Assets will not be loaded form fields because the view is already loaded. Include the possible assets in the controller., (*11)

For example a Matrix field that uses an image field will need to include image.js., (*12)

$paths = \TypeRocket\Config::getPaths();
\TypeRocket\Assets::addToFooter('js', 'typerocket-image', $paths['urls']['js'] . '/image.js');

Media

Typerocket Media uses https://github.com/eventviva/php-image-resize to create thumbnails., (*13)

Unsplash

To enable, set the typerocket.media.unsplash.enabled to true, and set the the Unsplash client ID in typerocket.media.unsplash.client_id., (*14)

To add the Unsplash button and modal anywhere, use the custom Blade directive @tr_unsplash., (*15)

The Versions

12/07 2018

dev-master

9999999-dev https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

BSD GPL-3.0-or-later

The Requires

 

The Development Requires

forms fields typerocket

12/07 2018

v2.1.23

2.1.23.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

GPL-3.0-or-later

The Requires

 

The Development Requires

forms fields typerocket

22/06 2018

v2.1.22

2.1.22.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

GPL-3.0-or-later

The Requires

 

The Development Requires

forms fields typerocket

22/06 2018

v2.1.21

2.1.21.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

GPL-3.0-or-later

The Requires

 

The Development Requires

forms fields typerocket

19/06 2018

v2.1.20

2.1.20.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

GPL-3.0-or-later

The Requires

 

The Development Requires

forms fields typerocket

08/05 2018

v2.1.19

2.1.19.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

GPL-3.0-or-later

The Requires

 

The Development Requires

forms fields typerocket

03/05 2018

v2.1.18

2.1.18.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

GPL-3.0-or-later

The Requires

 

The Development Requires

forms fields typerocket

03/05 2018

v2.1.17

2.1.17.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

GPL-3.0-or-later

The Requires

 

The Development Requires

forms fields typerocket

16/03 2018

v2.1.16

2.1.16.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

GPL-3.0-or-later

The Requires

 

The Development Requires

forms fields typerocket

27/02 2018

v2.1.15

2.1.15.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

GPL-3.0-or-later

The Requires

 

The Development Requires

forms fields typerocket

27/02 2018

dev-kevindees-image-search

dev-kevindees-image-search https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

BSD GPL-3.0-or-later

The Requires

 

The Development Requires

forms fields typerocket

27/02 2018

v2.1.14

2.1.14.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

GPL-3.0-or-later

The Requires

 

The Development Requires

forms fields typerocket

20/12 2017

v2.1.13

2.1.13.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

BSD

The Requires

 

The Development Requires

forms fields typerocket

20/12 2017

v2.1.12

2.1.12.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

BSD

The Requires

 

The Development Requires

forms fields typerocket

04/10 2017

v2.1.11

2.1.11.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

BSD

The Requires

 

The Development Requires

forms fields typerocket

08/09 2017

v2.1.10

2.1.10.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

BSD

The Requires

 

The Development Requires

forms fields typerocket

07/09 2017

v2.1.9

2.1.9.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

BSD

The Requires

 

The Development Requires

forms fields typerocket

07/09 2017

v2.1.8

2.1.8.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

BSD

The Requires

 

The Development Requires

forms fields typerocket

25/08 2017

v2.1.7

2.1.7.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

BSD

The Requires

 

The Development Requires

forms fields typerocket

23/08 2017

v2.1.6

2.1.6.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

BSD

The Requires

 

The Development Requires

forms fields typerocket

23/08 2017

v2.1.5

2.1.5.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

BSD

The Requires

 

The Development Requires

forms fields typerocket

22/08 2017

v2.1.3

2.1.3.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

BSD

The Requires

 

The Development Requires

forms fields typerocket

22/08 2017

v2.1.4

2.1.4.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

BSD

The Requires

 

The Development Requires

forms fields typerocket

22/08 2017

v2.1.2

2.1.2.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

BSD

The Requires

 

The Development Requires

forms fields typerocket

22/08 2017

v2.1.1

2.1.1.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

BSD

The Requires

 

The Development Requires

forms fields typerocket

22/08 2017

v2.1.0

2.1.0.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

BSD

The Requires

 

The Development Requires

forms fields typerocket

05/07 2017

v2.0.6

2.0.6.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

BSD

The Requires

 

The Development Requires

forms fields typerocket

10/06 2017

v2.0.5

2.0.5.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

BSD

The Requires

 

The Development Requires

forms fields typerocket

24/05 2017

v2.0.4

2.0.4.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

BSD

The Requires

 

The Development Requires

forms fields typerocket

20/05 2017

v2.0.3

2.0.3.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

BSD

The Requires

 

The Development Requires

forms fields typerocket

16/11 2016

v2.0.2

2.0.2.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

BSD

The Requires

 

The Development Requires

forms fields typerocket

12/10 2016

v2.0.1

2.0.1.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

BSD

The Requires

 

The Development Requires

forms fields typerocket

10/10 2016

v2.0.0

2.0.0.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

BSD

The Requires

 

The Development Requires

forms fields typerocket

10/10 2016

v2.0.0-RC2

2.0.0.0-RC2 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

BSD

The Requires

 

The Development Requires

forms fields typerocket

10/10 2016

v2.0.0-RC1

2.0.0.0-RC1 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

BSD

The Requires

  • php >=5.5.9

 

The Development Requires

forms fields typerocket

15/07 2016

v1.0.17

1.0.17.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

BSD

The Requires

  • php >=5.4

 

The Development Requires

forms fields typerocket

14/07 2016

v1.0.16

1.0.16.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

BSD

The Requires

  • php >=5.4

 

The Development Requires

forms fields typerocket

06/05 2016

v1.0.15

1.0.15.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

BSD

The Requires

  • php >=5.4

 

The Development Requires

forms fields typerocket

11/04 2016

v1.0.14

1.0.14.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

BSD

The Requires

  • php >=5.4

 

The Development Requires

forms fields typerocket

23/03 2016

v1.0.13

1.0.13.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

BSD

The Requires

  • php >=5.4

 

The Development Requires

forms fields typerocket

08/03 2016

v1.0.12

1.0.12.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

BSD

The Requires

  • php >=5.4

 

The Development Requires

forms fields typerocket

24/02 2016

v1.0.11

1.0.11.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

BSD

The Requires

  • php >=5.4

 

The Development Requires

forms fields typerocket

24/02 2016

v1.0.10

1.0.10.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

BSD

The Requires

  • php >=5.4

 

The Development Requires

forms fields typerocket

17/02 2016

v1.0.9

1.0.9.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

BSD

The Requires

  • php >=5.4

 

The Development Requires

forms fields typerocket

04/02 2016

v1.0.8

1.0.8.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

BSD

The Requires

  • php >=5.4

 

The Development Requires

forms fields typerocket

21/01 2016

v1.0.7

1.0.7.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

BSD

The Requires

  • php >=5.4

 

The Development Requires

forms fields typerocket

21/01 2016

v1.0.6

1.0.6.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

BSD

The Requires

  • php >=5.4

 

The Development Requires

forms fields typerocket

15/01 2016

v1.0.5

1.0.5.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

BSD

The Requires

  • php >=5.4

 

The Development Requires

forms fields typerocket

28/12 2015

v1.0.4

1.0.4.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

BSD

The Requires

  • php >=5.4

 

The Development Requires

forms fields typerocket

28/12 2015

v1.0.3

1.0.3.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

BSD

The Requires

  • php >=5.4

 

The Development Requires

forms fields typerocket

22/12 2015

v1.0.2

1.0.2.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

BSD

The Requires

  • php >=5.4

 

The Development Requires

forms fields typerocket

08/10 2015

1.0.1

1.0.1.0 https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

BSD

The Requires

  • php >=5.4

 

The Development Requires

forms fields typerocket

08/10 2015

v1.0.1-beta

1.0.1.0-beta https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

BSD

The Requires

  • php >=5.4

 

The Development Requires

forms fields typerocket

22/09 2015

v1.0.0-beta

1.0.0.0-beta https://github.com/TypeRocket/laravel

Makes form building and model binding a breeze.

  Sources   Download

BSD

The Requires

  • php >=5.4

 

The Development Requires

forms fields typerocket