htech / mock-entry
Mock entries for easy management. Create database entries that will not show in production
Installs: 21
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:project
This package is auto-updated.
Last update: 2024-10-04 13:06:24 UTC
README
Laravel Mocker
Mock entries for easy management. Create database entries that will not show in production
Installation
composer require htech/mock-entry
Usage
- If you want to save data for testing just turn on debug mode in
.env
APP_DEBUG = TRUE
- Add
MockEntry
trait to your models.
<?php
namespace App;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Passport\HasApiTokens;
use Htech\MockEntry\Traits\MockEntry;
class User extends Authenticatable
{
use HasApiTokens,MockEntry;
- Add
for_testing
column with data type of tinyInteger in the table you want to use mock entries.
Schema::table([table_name], function (Blueprint $table) {
$table->tinyInteger('for_testing')->default(1);
});
- If you want to delete all mock entries in your database access this route.
{{root}}/remove-test-data
Troubleshooting
- If you have problems in installing with lower versions of PHP. Try adding params
ignore-platform-reqs
in composer require
composer require htech/mock-entry --ignore-platform-reqs
- If configuration doesn't allow you to allow connections to the server especially in your localhost. try this command before installing the package. (Not Recommended)
composer config -g secure-http false
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
License
The GNU General Public License v3.0 (GNU GPLv3). Please see License File for more information.