-
Run in your terminal
composer require jsdecena/baserepo -
Add the base service provider in your
config/app.phpfile like this:
'providers' => [| public function testUpdateBook() { | |
| $book = factory(Book::class)->create(); | |
| $data = [ | |
| 'author' => 'John Doe' | |
| ]; | |
| $this->put(route('book.update', $book->id), $data) | |
| ->assertStatus(200) |
| this.criteria.forEach(crit => { | |
| this.form.responses.forEach(resp => { | |
| if (resp.form_criteria_id === crit.form_criteria_id) { | |
| return crit.value = resp.value; | |
| } | |
| }); | |
| }); | |
| console.log(this.criteria, '<<<'); |
| // Questions array: | |
| const questions = [ | |
| { | |
| "form_criteria_id":"46", | |
| "field_name":"pumpstation_general", | |
| "field_label":"General repairs required?", | |
| "mandatory":false, | |
| "action":"dropdown", | |
| "input_type":[ | |
| { |
| <template> | |
| <section> | |
| <div class="field" v-for="q in questions"> | |
| <div class="wrap" v-if="q.type === "q""> | |
| <label>{{q.name}}</label> | |
| <select @change="onChange($event)"> | |
| <option | |
| :key="a.value" | |
| :value="a.text" | |
| v-for="a in q.answer"> |
| $test = 'ACCOUNT_PERFORMANCE_REPORT (Sep 13, 2018-Sep 19, 2018)"\n | |
| Account,Clicks,Impressions,CTR,Conversions,Conv. rate,Cost,Avg. position,Avg. CPC,Day\n | |
| Massive Infinity,104,6115,1.70%,2.00,2.30%,79610000,1.2,765481,2018-09-17\n | |
| Massive Infinity,16,716,2.23%,0.00,0.00%,116140000,2.7,7258750,2018-09-14\n | |
| Massive Infinity,0,69,0.00%,0.00,0.00%,0,1.0,0,2018-09-15\n | |
| Massive Infinity,86,8633,1.00%,0.00,0.00%,155350000,1.2,1806395,2018-09-18\n | |
| Massive Infinity,91,7758,1.17%,1.00,1.28%,119260000,1.1,1310549,2018-09-19\n | |
| Massive Infinity,5,699,0.72%,0.00,0.00%,44850000,2.7,8970000,2018-09-13\n | |
| Massive Infinity,0,95,0.00%,0.00,0.00%,0,1.0,0,2018-09-16\n | |
| Total,302,24085,1.25%,3.00,1.12%,515210000,1.3,1705993, --\n'; |
| import UserService from './user.service.js'; | |
| ... | |
| data() { | |
| return { | |
| users: [] | |
| } | |
| }, | |
| mounted() { | |
| loadUsers(); | |
| }, |
| // Question: How can I extract the "DataTransformer" class and reference it back here? | |
| // Solved!!! | |
| <script> | |
| // extract this in <root>/src/helpers/helper.js (or anywhere you want it) | |
| export class DataTransformer { | |
| static transform(data) { | |
| const transformedData = {}; | |
| .... | |
| return transformedData |
| /** | |
| * @param array $params | |
| * | |
| * @param $orderBy | |
| * @param $sortBy | |
| * | |
| * @return Collection | |
| * | |
| * Sample: | |
| * `/orders?release_date_start=2018-01-01&release_date_end=2018-02-20&firm_id=3` OR |
| image: node:6.9.4 | |
| pipelines: | |
| branches: | |
| master: | |
| - step: | |
| caches: | |
| - node_modules | |
| script: | |
| - npm install | |
| - npm run test --single-run |