Skip to content
This repository was archived by the owner on Jan 27, 2023. It is now read-only.

Commit 64489bd

Browse files
committed
WIP
1 parent 6e69531 commit 64489bd

File tree

2 files changed

+33
-14
lines changed

2 files changed

+33
-14
lines changed

.phpunit.result.cache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
C:37:"PHPUnit\Runner\DefaultTestResultCache":1172:{a:2:{s:7:"defects";a:3:{s:92:"CraftLogan\LaravelOverflow\Tests\ExampleTest::it_can_add_extra_properties_with_create_method";i:4;s:96:"CraftLogan\LaravelOverflow\Tests\ExampleTest::it_can_add_extra_properties_using_model_attributes";i:4;s:70:"CraftLogan\LaravelOverflow\Tests\ExampleTest::it_can_get_table_columns";i:5;}s:5:"times";a:8:{s:92:"CraftLogan\LaravelOverflow\Tests\ExampleTest::it_can_add_extra_properties_with_create_method";d:0.01;s:96:"CraftLogan\LaravelOverflow\Tests\ExampleTest::it_can_add_extra_properties_using_model_attributes";d:0.003;s:94:"CraftLogan\LaravelOverflow\Tests\ExampleTest::it_can_add_multiple_extra_properties_to_overflow";d:0.086;s:70:"CraftLogan\LaravelOverflow\Tests\ExampleTest::it_can_get_table_columns";d:0.003;s:95:"CraftLogan\LaravelOverflow\Tests\OverflowTest::it_can_add_multiple_extra_properties_to_overflow";d:0.084;s:93:"CraftLogan\LaravelOverflow\Tests\OverflowTest::it_can_add_extra_properties_with_create_method";d:0.01;s:71:"CraftLogan\LaravelOverflow\Tests\OverflowTest::it_can_get_table_columns";d:0.003;s:97:"CraftLogan\LaravelOverflow\Tests\OverflowTest::it_can_add_extra_properties_using_model_attributes";d:0.003;}}}
1+
C:37:"PHPUnit\Runner\DefaultTestResultCache":1173:{a:2:{s:7:"defects";a:3:{s:92:"CraftLogan\LaravelOverflow\Tests\ExampleTest::it_can_add_extra_properties_with_create_method";i:4;s:96:"CraftLogan\LaravelOverflow\Tests\ExampleTest::it_can_add_extra_properties_using_model_attributes";i:4;s:70:"CraftLogan\LaravelOverflow\Tests\ExampleTest::it_can_get_table_columns";i:5;}s:5:"times";a:8:{s:92:"CraftLogan\LaravelOverflow\Tests\ExampleTest::it_can_add_extra_properties_with_create_method";d:0.01;s:96:"CraftLogan\LaravelOverflow\Tests\ExampleTest::it_can_add_extra_properties_using_model_attributes";d:0.003;s:94:"CraftLogan\LaravelOverflow\Tests\ExampleTest::it_can_add_multiple_extra_properties_to_overflow";d:0.086;s:70:"CraftLogan\LaravelOverflow\Tests\ExampleTest::it_can_get_table_columns";d:0.003;s:95:"CraftLogan\LaravelOverflow\Tests\OverflowTest::it_can_add_multiple_extra_properties_to_overflow";d:0.106;s:93:"CraftLogan\LaravelOverflow\Tests\OverflowTest::it_can_add_extra_properties_with_create_method";d:0.012;s:71:"CraftLogan\LaravelOverflow\Tests\OverflowTest::it_can_get_table_columns";d:0.003;s:97:"CraftLogan\LaravelOverflow\Tests\OverflowTest::it_can_add_extra_properties_using_model_attributes";d:0.003;}}}

README.md

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
![Laravel Overflow Logo](https://raw.githubusercontent.com/CraftLogan/Laravel-Overflow/master/Laravel%20Overflow.png)
1+
![Laravel Overflow Logo](https://raw.githubusercontent.com/CraftLogan/Laravel-Overflow/master/Laravel%20Overflow.png#logo)
2+
23

3-
# Laravel Overflow
44
[![Latest Version on Packagist](https://img.shields.io/packagist/v/craftlogan/laravel-overflow.svg?style=flat-square)](https://packagist.org/packages/craftlogan/laravel-overflow)
55
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/spatie/laravel-responsecache/run-tests?label=tests)
66
[![MIT Licensed](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
77
[![Quality Score](https://img.shields.io/scrutinizer/g/craftlogan/laravel-overflow.svg?style=flat-square)](https://scrutinizer-ci.com/g/craftlogan/laravel-overflow)
88
[![Total Downloads](https://img.shields.io/packagist/dt/craftlogan/laravel-overflow.svg?style=flat-square)](https://packagist.org/packages/craftlogan/laravel-overflow)
99

10-
The Laravel Overflow package will allow to easily add an overflow column to a form request. Use this package to make it easy to store overflow request values in a json column on database table:)
10+
# Laravel Overflow
11+
12+
The Laravel Overflow package will allow adding an overflow column to a form request easily. Use this package to make it easy to store overflow request values in a JSON or Text column on a database table:)
1113
## Installation
1214

1315
You can install the package via composer:
@@ -23,17 +25,18 @@ Defining the overflow column and table using a custom form request:
2325
``` php
2426
<?php
2527

26-
namespace App\Http\Requests;
28+
namespace CraftLogan\LaravelOverflow\Requests;
2729

2830
use Illuminate\Foundation\Http\FormRequest;
2931
use CraftLogan\LaravelOverflow\Overflowable;
3032

31-
class CustomFormRequest extends FormRequest
33+
class OverflowFormRequest extends FormRequest
3234
{
3335
use Overflowable;
34-
public $table = 'programs';
36+
public $table = 'test_models';
3537
public $overflow_column = 'properties';
3638

39+
3740
/**
3841
* Determine if the user is authorized to make this request.
3942
*
@@ -61,16 +64,36 @@ Using with the CREATE Method:
6164
``` php
6265
public function store(CustomFormRequest $request)
6366
{
64-
$mymodel = MyModel::create($request->allWithOverflow());
67+
$testmodel = TestModel::create($request->allWithOverflow());
6568
}
6669
```
6770

6871
Using with the object Attributes:
6972

7073
``` php
71-
// Usage description here
74+
$testmodel = new TestModel();
75+
$testmodel->name = $request->name;
76+
$testmodel->properties = $request->overflow();
77+
$testmodel->save();
7278
```
7379

80+
81+
When setting up a migration you can use a json column or a text column:
82+
83+
``` php
84+
public function up()
85+
{
86+
Schema::create('test_models', function (Blueprint $table){
87+
$table->increments('id');
88+
//$table->text('properties'); // Use this column type if you are using sqlite or a mysql version less than 5.7
89+
//$table->json('properties'); // If your database supports json then I would recommend using the json column
90+
$table->timestamps();
91+
});
92+
}
93+
94+
```
95+
96+
7497
### Testing
7598

7699
``` bash
@@ -85,9 +108,6 @@ Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recen
85108

86109
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
87110

88-
### Security
89-
90-
If you discover any security related issues, please email craftlogan@gmail.com instead of using the issue tracker.
91111

92112
## Credits
93113

@@ -98,6 +118,5 @@ If you discover any security related issues, please email craftlogan@gmail.com i
98118

99119
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
100120

101-
## Laravel Package Boilerplate
102121

103-
This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).
122+
This package used scafolding from the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com) built by [Marcel Pociot](https://twitter.com/marcelpociot)

0 commit comments

Comments
 (0)