patinthehat/laravel-support
Larablocks Analysis
patinthehat/laravel-support works with any PHP project: the latest release (v1.2.2, Apr 2, 2017) doesn't depend on Laravel.
Recommendation checks
Not advisedNot advised: no release or commit in over 2 years.
- No release or commit in over 2 years
- No release in the last 12 months (last: Apr 2, 2017)
- 0 downloads a month (needs 10,000)
- 1 GitHub star (needs 100)
State
Likely abandoned- No release or commit in over 2 years.
- Last stable release: Apr 2, 2017.
- No releases in the last 12 months.
- First released: Feb 17, 2017.
- 0 open issues on GitHub.
Data from Packagist and GitHub, checked by Larablocks on Dec 3, 2026.
| Install | |
|---|---|
composer require patinthehat/laravel-support |
|
| Latest Version: | v1.2.2 |
| PHP: | >=5.6.4 |
| License: | MIT |
| Last Updated: | Apr 2, 2017 |
| Links: | GitHub · Packagist |
LaravelSupport
Various support classes for Laravel 5+.
####Installation
Install with composer:
composer require patinthehat/laravel-support
Classes
#####ExtendedSeeder
ExtendedSeeder is an extended version of the Seeder class and provides easy foreign key check enable/disable and table truncating. It also allows for easy access to Faker.
######Methods
getFaker()- returns an instance of Faker\Factory (see Faker).init($tableName, $disableForeignKeyChecks = true, $deleteAllTableEntries = true)- call at the beginning ofrun().cleanup()- call at the end ofrun().
######Sample Usage:
use App\Support\ExtendedSeeder;
use App\User;
class UserTableSeeder extends ExtendedSeeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
//disable foreign key checks, delete all existing table entries
$this->init('users', true, true);
//seed the table
$text = $this->getFaker()->text();
$this->cleanup();
}
}
#####ExtendedMigration
ExtendedMigration is an extended version of the Migration class and provides easy foreign key creation/deletion.
######Methods
######Sample Usage:
use LaravelSupport\Database\ExtendedMigration;
class CreateForeignKeys extends ExtendedMigration
{
//define the FKs
protected $foreignKeyDefinitions = [
'info.author_id' => ['authors.id', 'cascade', 'cascade'],
'info.book_id' => ['books.id', null, null],
'table2.test_id' => 'tests.id',
'myinfo.publisher_id' => null, //creates FK on 'publishers.id'
];
//automatically create/delete FKs
protected $autoCreateDefinedKeys = true;
protected $autoDeleteDefinedKeys = true;
}
License
LaravelSupport is available under the MIT License.
Related Packages
Powerful PHP database abstraction layer (DBAL) with many features for database s...
Laravel Serializable Closure provides an easy and secure way to serialize closur...
Cli error handling for console/command-line PHP applications.
Version History
| Version | Released | PHP | License |
|---|---|---|---|
| v1.2.2 | >=5.6.4 | MIT | |
| v1.2.1 | >=5.6.4 | MIT | |
| v1.2.0 | >=5.6.4 | MIT | |
| v1.1.0 | >=5.6.4 | MIT | |
| v1.0.2 | >=5.6.4 | MIT | |
| v1.0.1 | >=5.6.4 | MIT | |
| v1.0.0 | >=5.6.4 | MIT |