2017 © Pedro Peláez
 

library laravel-helper

A collection of usefull helpers for the Laravel Framework.

image

brotzka/laravel-helper

A collection of usefull helpers for the Laravel Framework.

  • Saturday, September 9, 2017
  • by Brotzka
  • Repository
  • 1 Watchers
  • 0 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Laravel-Helpers

This is a collection of usefull helper-functions for the Laravel-Framework., (*1)

Installation

First, install the package:, (*2)

composer require brotzka/laravel-helper, (*3)

Now you should add the HelperServiceProvider to your config/app.php providers-array:, (*4)

    'providers' => [
        // ...
        // Other ServiceProvider 
        // ...
        Brotzka\LaravelHelper\HelperServiceProvider::class,
    ],

Helpers

Here you can find a short description of all available functions. Feel free to contribute., (*5)

Slug-Helper

This Helper simply creates a unique slug for a specific model/table. If you update a model, simple add the ID of the Model to the function and it will be ignored., (*6)

Include the SlugHelper in your file (e.g. your Controller):, (*7)


namespace App\Http\Controllers; use Illuminate\Http\Request; use App\BlogPost; use Brotzka\LaravelHelper\Helpers\SlugHelper; class YourController extends Controller { public function store(Request $request) { $post = new BlogPost(); $post->title = $request->input('title'); $slug = new SlugHelper('posts', 'mysql'); $post->slug = $slug->createUniqueSlug($post->title); // ... $post->save(); } public function update(Request $request, $id) { $post = BlogPost::findOrFail($id); $post->title = $request->input('title'); $slug = new SlugHelper('posts', 'mysql'); $post->slug = $slug->createUniqueSlug($post->title, $post->id); // ... $post->save(); } }

The Versions

09/09 2017

dev-master

9999999-dev

A collection of usefull helpers for the Laravel Framework.

  Sources   Download

MIT

by Fabian Hagen

laravel helper slug

09/09 2017

v1.0.0

1.0.0.0

A collection of usefull helpers for the Laravel Framework.

  Sources   Download

MIT

by Fabian Hagen

laravel helper slug