2017 © Pedro Peláez
 

library flashable

A simple trait to flash when model events are fired, like `created`, `updated`, and `saved`.

image

tonning/flashable

A simple trait to flash when model events are fired, like `created`, `updated`, and `saved`.

  • Monday, September 4, 2017
  • by tonning
  • Repository
  • 1 Watchers
  • 1 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Flashable

A simple trait to flash when model events are fired, like created, updated, and saved. Using Jeffrey Way's excellent Flash package to actually display the flash messages., (*1)

Installation

Begin by pulling in the package through Composer., (*2)

composer require tonning/flashable

Then add the trait to the model you want to automatically flash on crud actions., (*3)

use Tonning\Flashable\Flashable;

class Post extends Model
{
    use Flashable;

    ...
}

Customization

You can specify the name of the model by adding a getModelName method on you model., (*4)

public function getModelName() {
  return 'Blog post';
}

For even more fine grain control you can add a protected property on the model., (*5)

protected $flashable = [
  'created' => 'Your blog post have been created. Good job!',
  'updated' => 'I hope nobody saw those mistakes...',
  'deleted' => 'Be gone blog post!'
]

The Versions

04/09 2017

dev-master

9999999-dev https://github.com/tonning/flashable

A simple trait to flash when model events are fired, like `created`, `updated`, and `saved`.

  Sources   Download

MIT

The Requires

 

04/09 2017

1.0.1

1.0.1.0 https://github.com/tonning/flashable

A simple trait to flash when model events are fired, like `created`, `updated`, and `saved`.

  Sources   Download

MIT

The Requires

 

04/09 2017

1.0.0

1.0.0.0 https://github.com/tonning/flashable

A simple trait to flash when model events are fired, like `created`, `updated`, and `saved`.

  Sources   Download

MIT