opheliadesign

CEO/Owner/Developer at Ophelia Design

Experience

41,415

11 Best Reply Awards

  • Member Since 2 Years Ago
  • 138 Lessons Completed
  • 0 Favorites

13th September, 2017

opheliadesign left a reply on PHP 7.1 Upgrade Failed • 1 month ago

@bashy the client may blow a gasket if I have to switch DNS and cause downtime.

Do you think that the tutorial I linked to is worth a t

opheliadesign left a reply on PHP 7.1 Upgrade Failed • 1 month ago

@bashy kind of thought that this Forge feature was supposed to execute whatever commands were necessary to complete the upgrade? The server was provisioned not too long ago through Forge. Clearly bugs in Taylor's feature, still nothing from him. Gets frustrating sometimes.

And everything would be fine if Composer was not updating when pushing changes, the modified files were mostly Javascript.

Anyway, I found this tutorial - https://brysemeijer.com/blog/5/laravel-forge-upgrade-to-php-71. What do you think? I would appreciate any help you can give, impatient client. I used to run Ubuntu on my machine, somewhat know my way around. :)

12th September, 2017

opheliadesign left a reply on PHP 7.1 Upgrade Failed • 1 month ago

Also, my dev environment is is 7.1. If I switch to 7.0.1 and run Composer again, might this rectify the problem? Or reverting composer.lock?

I really need to push code to this server. I'd like to upgrade PHP but need to bypass the Composer 7.1 requirement in the short term.

It would be gte

opheliadesign left a reply on PHP 7.1 Upgrade Failed • 1 month ago

This is a Digital Ocean server, by the way.

opheliadesign left a reply on PHP 7.1 Upgrade Failed • 1 month ago

@bashy yes, provisioned on Forge.

opheliadesign started a new conversation PHP 7.1 Upgrade Failed • 1 month ago

Hi everyone,

I reached out to Taylor via support but hope that the community here might be able to lend a hand a bit quicker.

I clicked on the "Upgrade PHP" button within Forge on one of my servers and it now states that I am running the current version. I attempted to push changes that require 7.1 and the server is still running 7.0.1. I attempted a reboot and nothing changed.

In the Forge logs, the output from the upgrade is:

Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package php7.1-fpm
E: Couldn't find any package by regex 'php7.1-fpm'
E: Unable to locate package php7.1-cli
E: Couldn't find any package by regex 'php7.1-cli'
E: Unable to locate package php7.1-dev
E: Couldn't find any package by regex 'php7.1-dev'
E: Unable to locate package php7.1-pgsql
E: Couldn't find any package by regex 'php7.1-pgsql'
E: Unable to locate package php7.1-sqlite3
E: Couldn't find any package by regex 'php7.1-sqlite3'
E: Unable to locate package php7.1-gd
E: Couldn't find any package by regex 'php7.1-gd'
E: Unable to locate package php7.1-curl
E: Couldn't find any package by regex 'php7.1-curl'
E: Unable to locate package php7.1-memcached
E: Couldn't find any package by regex 'php7.1-memcached'
E: Unable to locate package php7.1-imap
E: Couldn't find any package by regex 'php7.1-imap'
E: Unable to locate package php7.1-mysql
E: Couldn't find any package by regex 'php7.1-mysql'
E: Unable to locate package php7.1-mbstring
E: Couldn't find any package by regex 'php7.1-mbstring'
E: Unable to locate package php7.1-xml
E: Couldn't find any package by regex 'php7.1-xml'
E: Unable to locate package php7.1-zip
E: Couldn't find any package by regex 'php7.1-zip'
E: Unable to locate package php7.1-bcmath
E: Couldn't find any package by regex 'php7.1-bcmath'
E: Unable to locate package php7.1-soap
E: Couldn't find any package by regex 'php7.1-soap'
E: Unable to locate package php7.1-intl
E: Couldn't find any package by regex 'php7.1-intl'
E: Unable to locate package php7.1-readline
E: Couldn't find any package by regex 'php7.1-readline'
E: Unable to locate package php7.1-mcrypt
E: Couldn't find any package by regex 'php7.1-mcrypt'
E: Unable to locate package php-msgpack
E: Unable to locate package php-igbinary

Any ideas? All I did was click the button.

11th September, 2017

opheliadesign left a reply on This Every Urgent Please Help • 1 month ago

Can you please provide more code, such as the methods that you are calling in the class?

This looks more like a general PHP question than a Laravel one as I do not see any Laravel syntax.

20th August, 2017

opheliadesign left a reply on Laravel Mix Running Out Of RAM • 1 month ago

Update: I also tried this, which worked using Gulp in a previous project. I moved AdminLTE out of the bower directory and placed it under my less directory, all import paths are correct. Laravel Mix runs out of memory while trying to process the modified AdminLTE.less file.

/*!
 *   AdminLTE v2.3.8
 *   Author: Almsaeed Studio
 *   Website: Almsaeed Studio <http://almsaeedstudio.com>
 *   License: Open source - MIT
 *           Please visit http://opensource.org/licenses/MIT for more information
!*/
@import "../../../../bower/bootstrap/less/bootstrap";
@import "../../../../bower/font-awesome/less/font-awesome";
@import url(https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic);
@import "skins/skin-blue.less";

@icon-font-path: "/fonts/";
@fa-font-path: "/fonts/";

@headings-small-color: @gray-dark;
@hr-border: #c3c3c3;

[v-cloak] {
  display: none !important;
}

// Full Calendar width fix
.fc-day-grid-event > .fc-content {
  white-space: normal !important;
}
//MISC
//----
@import "core.less";
@import "variables.less";
@import "mixins.less";
//COMPONENTS
//-----------
@import "header.less";
@import "sidebar.less";
@import "sidebar-mini.less";
@import "control-sidebar.less";
@import "dropdown.less";
@import "forms.less";
@import "progress-bars.less";
@import "small-box.less";
@import "boxes.less";
@import "info-box.less";
@import "timeline.less";
@import "buttons.less";
@import "callout.less";
@import "alerts.less";
@import "navs.less";
@import "products.less";
@import "table.less";
@import "labels.less";
@import "direct-chat.less";
@import "users-list.less";
@import "carousel.less";
@import "modal.less";
@import "social-widgets.less";
//PAGES
//------
@import "mailbox.less";
@import "lockscreen.less";
@import "login_and_register.less";
@import "404_500_errors.less";
@import "invoice.less";
@import "profile";
//Plugins
//--------
@import "plugins.less";
//Miscellaneous
//-------------
@import "miscellaneous.less";
@import "print.less";

opheliadesign left a reply on Laravel Mix Running Out Of RAM • 1 month ago

@danmatthews no dice, any other ideas? Hangs when trying to run admin.less, removed references to Bootstrap in AdminLTE.

Could it just be the large number of imports that AdminLTE.less contains?

8th August, 2017

opheliadesign started a new conversation Laravel Mix Running Out Of RAM • 2 months ago

I am attempting to compile several LESS files (Bootstrap, Font Awesome, and AdminLTE) using webpack (Laravel Mix) and the process seems to fail due to a memory issue. Stack trace:

Security context: 00000373F6C3FA99 <JS Object>
    1: /* anonymous */ [C:\Users\Benjamin\PhpstormProjects\cvahimt-dev\node_modules\less\lib\less\tree\ruleset.js:239] [pc=000003481D34EFF1] (this=000000EF94336CF9 <JS Global Object>,hash=000003EF61DE84D9 <an Object with map 0000004273E06829>,r=00000335983FB711
 <a Rule with map 000001FD8BF7D5C9>)
    2: arguments adaptor frame: 4->2
    3: InnerArrayReduce(aka InnerArrayReduce) [native array....

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

npm ERR! Windows_NT 10.0.15063
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "development"
npm ERR! node v6.11.2
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 3
npm ERR!
npm ERR! Failed at the @ development script 'cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Benjamin\PhpstormProjects\cvahimt-dev\npm-debug.log

If I remove some of the files, it runs normally. Windows 10, 16 GB RAM, latest versions of Laravel Mix, NPM, and Node.

Any ideas??

9th July, 2017

opheliadesign left a reply on Export A PDF Document Under PHP 7.1 • 3 months ago

@Robstar thanks for the tip. I have multiple servers/projects utilizing maatwebsite/excel and his documentation is a lot easier to follow than PHPExcel.

I'm in a time crunch for a client complaining about this issue, I do not want to downgrade PHP versions because I hope to utilize PHP 7 for a revamp of their site.

I also found maatwebsite/laravel-excel-light, https://github.com/Maatwebsite/Laravel-Excel-Light. I may try that tomorrow.

If you have any experience with PHPExcel, would you mind tossing me a bone and showing me how to execute the code in my question using its direct syntax? :) I wish they had more concise documentation.

Thanks!

opheliadesign started a new conversation Export A PDF Document Under PHP 7.1 • 3 months ago

Hi everyone,

I have been using maatwebsite/excel to generate PDFs from data in our database. It worked great until I upgraded to PHP 7.1, now I receive the following error:

in /home/forge/cvahimt.org/vendor/phpoffice/phpexcel/Classes/PHPExcel/Cell.php:835```

It is my understanding that this is an issue with `phpoffice/phpexcel`.

Can anyone suggest an alternative to `maatwebsite/excel` with good documentation?

Here is my code to give you an idea of my current needs. Data is fetched by a helper class, should not be relevant:

$entriesObj = new personnelSpreadsheetEntry($users); \Excel::create('CVAHIMT-personnel-export-' . date("m-d-Y"), function ($excel) use ($entriesObj) { $excel->sheet('Personnel Listing', function ($sheet) use ($entriesObj) { $sheet->setOrientation('landscape'); $sheet->fromArray($entriesObj->generateContactSheet()); $sheet->row(1, function ($row) { $row->setFontWeight('bold'); $row->setBackground('#f2e296'); }); $sheet->setAutoFilter(); $sheet->setFreeze('C2'); }); $excel->sheet('Emergency Contacts', function($sheet) use ($entriesObj) { $sheet->setOrientation('landscape'); $sheet->fromArray($entriesObj->generateEmergencyContacts()); $sheet->row(1, function ($row) { $row->setFontWeight('bold'); $row->setBackground('#f2e296'); }); $sheet->setAutoFilter(); $sheet->setFreeze('C2'); }); $excel->getDefaultStyle() ->getAlignment() ->setHorizontal(\PHPExcel_Style_Alignment::HORIZONTAL_CENTER); $excel->setActiveSheetIndex(0); })->export("xls");

16th January, 2017

opheliadesign left a reply on Laravel 5.3, PHPStorm 2017.1 EAP, ESLint • 9 months ago

@ejdelmonico thanks for your reply! I wouldn't say they are completely personal preference, because up until this point I had never encountered ESLint. Not sure why it became an issue this go-around.

I created a new project using Laragon and noticed that it did not run npm installas part of its command set. I think that this caused the initial warnings and errors to appear. On the new project, I ran npm install, set ES6 in the Languages and Frameworks preferences, and made sure that NodeJS Core was enabled - no issues.

So, I guess it boils down to my lack of ESLint knowledge and PHPStorm's way of handling such files as the gulp file without the above mentioned preferences being set.

Now I know for next time!

Cheers!

15th January, 2017

opheliadesign left a reply on Laravel 5.3, PHPStorm 2017.1 EAP, ESLint • 9 months ago

Sorry to bump, but does anyone have any ideas? Surely I'm not the only PHPStorm user on here. :)

It does not seem to be limited to EAP. I noticed that there is an ESLint plugin available, I tried both that and running eslint --init.

Here is my current ESLint configuration. Mostly running into LF vs CRLF errors, anything produced by Webpack is just a giant block of red.

module.exports = {
    "env": {
        "browser": true,
        "es6": true
    },
    "extends": "eslint:recommended",
    "parserOptions": {
        "sourceType": "module"
    },
    "rules": {
        "accessor-pairs": "error",
        "array-bracket-spacing": "error",
        "array-callback-return": "error",
        "arrow-body-style": "error",
        "arrow-spacing": "error",
        "block-scoped-var": "error",
        "block-spacing": [
            "error",
            "always"
        ],
        "callback-return": "error",
        "camelcase": "off",
        "capitalized-comments": "off",
        "class-methods-use-this": "error",
        "comma-dangle": "error",
        "comma-spacing": [
            "error",
            {
                "after": true,
                "before": false
            }
        ],
        "comma-style": [
            "error",
            "last"
        ],
        "complexity": "error",
        "computed-property-spacing": [
            "error",
            "never"
        ],
        "consistent-return": "error",
        "consistent-this": "error",
        "curly": "off",
        "default-case": "error",
        "dot-location": "error",
        "dot-notation": [
            "error",
            {
                "allowKeywords": false
            }
        ],
        "eol-last": [
            "error",
            "never"
        ],
        "eqeqeq": "error",
        "func-call-spacing": "off",
        "func-name-matching": "error",
        "func-names": "off",
        "func-style": [
            "error",
            "declaration"
        ],
        "generator-star-spacing": "error",
        "global-require": "error",
        "guard-for-in": "error",
        "handle-callback-err": "error",
        "id-blacklist": "error",
        "id-length": [
            "error",
            {
                "properties": "never"
            }
        ],
        "id-match": "error",
        "indent": "off",
        "init-declarations": "error",
        "jsx-quotes": "error",
        "key-spacing": "error",
        "line-comment-position": "off",
        "linebreak-style": "off",
        "lines-around-comment": "error",
        "lines-around-directive": "error",
        "max-depth": "error",
        "max-len": "off",
        "max-lines": "error",
        "max-nested-callbacks": "error",
        "max-params": "error",
        "max-statements": "error",
        "max-statements-per-line": "off",
        "multiline-ternary": [
            "error",
            "always"
        ],
        "new-cap": "error",
        "new-parens": "error",
        "newline-after-var": "off",
        "newline-before-return": "off",
        "newline-per-chained-call": "error",
        "no-alert": "error",
        "no-array-constructor": "error",
        "no-await-in-loop": "error",
        "no-bitwise": "error",
        "no-caller": "error",
        "no-catch-shadow": "error",
        "no-confusing-arrow": "error",
        "no-continue": "error",
        "no-div-regex": "error",
        "no-duplicate-imports": "error",
        "no-else-return": "error",
        "no-empty-function": "error",
        "no-eq-null": "error",
        "no-eval": "off",
        "no-extend-native": "error",
        "no-extra-bind": "error",
        "no-extra-label": "error",
        "no-extra-parens": "error",
        "no-floating-decimal": "error",
        "no-implicit-coercion": "error",
        "no-implicit-globals": "error",
        "no-implied-eval": "error",
        "no-inline-comments": "off",
        "no-invalid-this": "error",
        "no-iterator": "error",
        "no-label-var": "error",
        "no-labels": "error",
        "no-lone-blocks": "error",
        "no-lonely-if": "error",
        "no-loop-func": "error",
        "no-magic-numbers": "error",
        "no-mixed-operators": "error",
        "no-mixed-requires": "error",
        "no-multi-spaces": "error",
        "no-multi-str": "error",
        "no-multiple-empty-lines": "error",
        "no-native-reassign": "error",
        "no-negated-condition": "error",
        "no-negated-in-lhs": "error",
        "no-nested-ternary": "error",
        "no-new": "error",
        "no-new-func": "error",
        "no-new-object": "error",
        "no-new-require": "error",
        "no-new-wrappers": "error",
        "no-octal-escape": "error",
        "no-param-reassign": "error",
        "no-path-concat": "error",
        "no-plusplus": "error",
        "no-process-env": "error",
        "no-process-exit": "error",
        "no-proto": "error",
        "no-prototype-builtins": "error",
        "no-restricted-globals": "error",
        "no-restricted-imports": "error",
        "no-restricted-modules": "error",
        "no-restricted-properties": "error",
        "no-restricted-syntax": "error",
        "no-return-assign": [
            "error",
            "except-parens"
        ],
        "no-return-await": "error",
        "no-script-url": "error",
        "no-self-compare": "error",
        "no-sequences": "error",
        "no-shadow": "error",
        "no-shadow-restricted-names": "error",
        "no-spaced-func": "off",
        "no-sync": "error",
        "no-tabs": "off",
        "no-template-curly-in-string": "error",
        "no-ternary": "off",
        "no-throw-literal": "error",
        "no-trailing-spaces": "error",
        "no-undef-init": "error",
        "no-underscore-dangle": "off",
        "no-unmodified-loop-condition": "error",
        "no-unneeded-ternary": "error",
        "no-unused-expressions": "error",
        "no-use-before-define": "error",
        "no-useless-call": "error",
        "no-useless-computed-key": "error",
        "no-useless-concat": "error",
        "no-useless-constructor": "error",
        "no-useless-escape": "error",
        "no-useless-rename": "error",
        "no-useless-return": "error",
        "no-var": "off",
        "no-void": "error",
        "no-warning-comments": "error",
        "no-whitespace-before-property": "error",
        "no-with": "error",
        "object-curly-newline": "error",
        "object-curly-spacing": "error",
        "object-property-newline": "error",
        "object-shorthand": "error",
        "one-var": "error",
        "one-var-declaration-per-line": "error",
        "operator-assignment": "error",
        "operator-linebreak": [
            "error",
            "after"
        ],
        "padded-blocks": "off",
        "prefer-arrow-callback": "error",
        "prefer-const": "error",
        "prefer-destructuring": "error",
        "prefer-numeric-literals": "error",
        "prefer-reflect": "off",
        "prefer-rest-params": "error",
        "prefer-spread": "error",
        "prefer-template": "error",
        "quote-props": "off",
        "quotes": "off",
        "radix": "error",
        "require-await": "error",
        "require-jsdoc": "error",
        "rest-spread-spacing": "error",
        "semi": "error",
        "semi-spacing": "error",
        "sort-imports": "error",
        "sort-keys": "off",
        "sort-vars": "error",
        "space-before-blocks": "error",
        "space-before-function-paren": "off",
        "space-in-parens": [
            "error",
            "never"
        ],
        "space-infix-ops": "error",
        "space-unary-ops": "error",
        "spaced-comment": "off",
        "strict": "error",
        "symbol-description": "error",
        "template-curly-spacing": "error",
        "unicode-bom": [
            "error",
            "never"
        ],
        "valid-jsdoc": "off",
        "vars-on-top": "off",
        "wrap-regex": "error",
        "yield-star-spacing": "error",
        "yoda": "error"
    }
};

14th January, 2017

opheliadesign left a reply on Laravel 5.3, PHPStorm 2017.1 EAP, ESLint • 9 months ago

UPDATE: If I add /* eslint-disable no-undef */ to the top of gulpfile.js, the warning goes away. Any ideas?

I also noticed that app.js has errors along the same lines, for example ESLint: Vue is not defined

opheliadesign started a new conversation Laravel 5.3, PHPStorm 2017.1 EAP, ESLint • 9 months ago

Trying to get rolling on my first Laravel 5.3 project, using PHPStorm 2017.1 EAP as my IDE.

5.3's Gulp file seems to make use of ES6 and PHPStorm is throwing all sorts of syntax errors. JSHint, JSLint, and ESLint are all foreign to me, I installed ESLint globally and that seems to have taken care of some warnings. I also managed to override JSHint to use ES6, which removed an error that "const" could not be found in the Gulp file. That just leaves me, so far, with a warning that 'require' cannot be found from ESLint.

Is there a guide somewhere on how to get this all working properly? I had not planned on starting down the path of ES6 yet but seem to have been sent that way anyway.

Running Windows 10, using Laragon to run a local dev environment.

Thanks in advance!

21st September, 2016

opheliadesign started a new conversation KeyBy On Sub Collection • 1 year ago

Hi everyone,

I am working on a VueJS project and need to return an object based JSON array. The parent array has sub arrays (in this case, a listing of skill groups and skills that a candidate possess) and is keyed by ID. I also need the listing of candidates to be keyed by ID, it is fetched using eager loading.

Code that I have now:

$skillGroups = SkillGroup::with(['candidateSkills' => function ($query) use ($candidateId) {
            $query->where('candidate_id', $candidateId); // Need to key by ID
        }])->whereHas('candidateSkills', function ($q) use ($candidateId) {
            $q->whereCandidateId($candidateId);
        })->get();

        return $skillGroups->keyBy('id');

Current Javascript object. I need the array under candidate_skills to be a listing of objects rather than a plain array.

 "skillGroups": {
    "8": {
      "id": 8,
      "title": "Human Resources",
      "slug": "human-resources",
      "created_at": "2016-08-22 13:46:08",
      "updated_at": "2016-08-22 13:46:08",
      "candidate_skills": [
        {
          "id": 660,
          "candidate_id": 78,
          "skill_id": 214,
          "skill_group_id": 8,
          "level_id": 3,
          "skill": {
            "id": 214,
            "title": "HRM Direct (applicant tracking system)",
            "slug": "hrm-direct-applicant-tracking-system",
            "description": null,
            "created_at": "2016-08-22 13:52:29",
            "updated_at": "2016-08-22 13:52:29",
            "skill_group_id": 8
          },
          "level": {
            "id": 3,
            "title": "Senior"
          }
        }
      ]
    }
  },

7th September, 2016

opheliadesign left a reply on Forge Deployment Down? • 1 year ago

@jekinney ah, maybe that was it. Resolved after about fifteen minutes, resetting the deployment state did not help.

opheliadesign started a new conversation Forge Deployment Down? • 1 year ago

Anyone else getting stuck with a perpetual Queued for Deployment message on Forge today? Tested in two projects.

10th May, 2016

opheliadesign left a reply on Tricky Table Relation • 1 year ago

@veve286 Thanks! I was able to use your suggestion and tweak it a bit to only retrieve SkillGroups that have Skills possessed by the given Candidate:

\App\SkillGroup::with(['skills.candidates' => function($query) {
            $query->wherePivot('candidate_id', 8)->addSelect('candidates.id', 'first_name', 'last_name');
        }])->whereHas('skills.candidates', function($q) {
            $q->whereCandidateId(8);
        })->get();

9th May, 2016

opheliadesign started a new conversation Tricky Table Relation • 1 year ago

Hi everyone, I've been struggling to figure out a table relationship for the past two days, I'm sure that the solution is simple but it is alluding me.

Four tables/models are involved:

  1. Skill - skills table. A Skill belongs to a SkillGroup and belongs to many Candidates (candidate_skill pivot table)
  2. Candidate - candidates table. Contains personal information on a candidate, not terribly related to the issue.
  3. SkillGroup - skill_groups table. Each Skill Group has many Skills.

I want to be able to retrieve Skill objects possessed by a Candidate grouped by the SkillGroup. For example:

[
{
"id": 1,
"title": "Information Technology (Skill Group)",
"slug": "information-technology",
"created_at": "2016-05-07 23:58:23",
"updated_at": "2016-05-07 23:58:23",
"skills": [
{
"id": 1,
"title": "Web Development (Skill)",
"slug": "web-development",
"description": "Web developers primarily focus on the back-end of websites",
"created_at": "2016-05-07 23:58:55",
"updated_at": "2016-05-07 23:58:55",
"skill_group_id": 1,
"candidates": [
{
"first_name": "John (Candidate)",
"last_name": "Smith"
"pivot": {
"skill_id": 1,
"candidate_id": 6
}
}
]
}
]
},

This is easy to accomplish with the following code, but I want to retrieve only results (SkillGroup -> Skills -> Candidate) for a specific candidate.

\App\SkillGroup::with('skills.candidates')->get()

I have tried the following (and everything else I can think of), the candidate_id does not seem to affect the query - I see skills that are not possessed by the given candidate.

\App\SkillGroup::with(['skills.candidates' => function($query) {
            $query->whereCandidateId(6);
        }])->get();

Any help would be greatly appreciated, thanks!

19th April, 2016

opheliadesign left a reply on Managing Phone Numbers • 1 year ago

@unohuim glad I was able to help. :) I try to store numbers as just digits in the DB (varchar) and format them from within the model (see the Getter / Setter) in my example.

I use Twilio often for voice / SMS, this setup has worked beautifully for that application. No problems whatsoever, Twilio can use a number formatted the same way that I prefer to display them - 444-444-4444. Or, if I want to use just digits, I can write a getter like formattedNumber($phoneNumber) which I can call in my views.

opheliadesign left a reply on Managing Phone Numbers • 1 year ago

@willvincent agreed. OP, curious if you need to use international numbers?

opheliadesign left a reply on Managing Phone Numbers • 1 year ago

@Prez Try the regex. Only works for US numbers but accepts just about every way someone would enter a number.

So what I do is validate against that regex and then strip everything but numbers. Working great on several projects.

opheliadesign left a reply on Managing Phone Numbers • 1 year ago

@premsaurav try the regex above out. Works great for US numbers.. but guessing that's not what you're dealing with. :)

I mostly work on custom member portals for US companies and organizations, zero chance of an international phone number. Not sure if the OP is dealing with something similar.

opheliadesign left a reply on Managing Phone Numbers • 1 year ago

If you will only be dealing with US phone numbers, here's how I do it. I use a regular varchar column (why text?) on the table.

On the model I use a setter to format the phone number (remove all but ten digits) prior to storing it and a getter to return it in this format: 444-444-4444:

public function setPhoneMobileAttribute($phone)
    {
        // Strip all but numbers
        $this->attributes['phone_mobile'] = trim(preg_replace('/^1|\D/', "", $phone));
    }

    public function getPhoneMobileAttribute($phoneNumber)
    {
        if ($phoneNumber) {
            $output = substr($phoneNumber, 0, 3) . '-' . substr($phoneNumber, 3, 3) . '-' . substr($phoneNumber, 6);

            return $output;
        }
    }

On the validation side, I use the following regex. It accepts the phone number in all of the common formats for US numbers, provided that it is a standard ten digit number. So the user can enter it however they wish and at the end it'll be stored as just numbers on the table.

/**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        $phoneRegex = "/^(?:(?:\+?1\s*(?:[.-]\s*)?)?(?:\(\s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\s*\)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\s*(?:[.-]\s*)?)?([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})\s*(?:[.-]\s*)?([0-9]{4})?$/";
        return [
            'first_name' => 'required',
            'last_name' => 'required',
            'email' => ['required', 'email', 'unique:users'],
            'phone_cell' => ['required', "regex:$phoneRegex", 'unique:users'],
            'user_type_id' => 'required',
            'password' => ['required', 'confirmed'],
            'username' => ['required', 'unique:users']
        ];
    }

opheliadesign left a reply on ->lists() Deprecated? Replacement? • 1 year ago

Thanks guys! Odd that PHPStorm just decided to list it as deprecated. Oh well. :)

opheliadesign started a new conversation ->lists() Deprecated? Replacement? • 1 year ago

Hi everyone,

I noticed this morning that the collection method ->lists() is deprecated. I have been looking around for information on what replaced this without much luck.

Example:

User::smsRecipients()->lists('phone_cell') :

opheliadesign left a reply on Polymorphism Or..? • 1 year ago

So, to clarify, there will be a general Photos section of the site with categories. Fleets and Regattas will have their own separate Photos section with their Albums. These albums will not have a category associated with them. So, an Album could technically belong to a category, fleet, or regatta. Make sense?

18th April, 2016

opheliadesign started a new conversation Polymorphism Or..? • 1 year ago

Hi everyone, Trying to decide the best database layout for a project. The site has a the typical news, events, and photos sections. It also has individual group sections, "Fleets" and "Regattas" (almost sub-sites within the primary one) with the same - news, photos, and events.

Repeating tables (for example, albums, fleet_albums, regatta_albums) is one option but very redundant. And while it makes it easy to retrieve albums etc. for a given Fleet, it becomes difficult to incorporate into the primary site's indexes.

On the primary site, for example, an Album belongs to an AlbumCategory and has many Photo. On the Fleets site, a FleetAlbum belongs to a Fleet and has many FleetPhoto. Otherwise every aspect is identical.

Ideally, we'd like to be able to quickly retrieve all albums for a Fleet but also display both regular albums (belonging to an AlbumCategory) and fleet albums (belonging to a Fleet) under one listing. Would polymorphism be the answer here?

Thanks!

24th February, 2016

opheliadesign left a reply on Forge / DO - Redirect To Non-www • 1 year ago

@bashy I simply had tunnel vision, figuring it had to be Nginix. I will know better next time.

opheliadesign left a reply on Forge / DO - Redirect To Non-www • 1 year ago

@ejdelmonico I stopped to eat lunch and then it hit me - I didn't set a www A record on the DNS. That's basically what Chrome was telling me. Set it on my phone after I ate, problem solved.

And, apparently, keeping default is fine after tweaking everything.

Moral of the story: take more breaks!

opheliadesign left a reply on Forge / DO - Redirect To Non-www • 1 year ago

Really pulling my hair out on this one, any suggestions would be appreciated.

The server was set up with the default site - default, rather than mydomain.com. I realized this after launching the site to production and installing the SSL cert, I am trying to avoid any downtime by trying to change this after the fact. I am not sure if the site being called default makes any difference here, but it's key to note.

So, https:// or http://mydomain.com works fine. www.mydomain.com returns a Server Not Found error on all browsers I've tested. I also noticed that there is a www.default file in /etc/nginx/sites-available, I tried changing it to the following and restarting nginx:

server {
    listen 80;
    server_name www.mysite.com;
    return 301 $scheme://mysite.com/$request_uri;
}

Still receiving Server Not Found no matter what.

opheliadesign started a new conversation Forge / DO - Redirect To Non-www • 1 year ago

Hi everyone,

I just transferred a site to a DO server provisioned by Forge. I installed an SSL certificate and noticed that navigating to https://www.mysite.com results in a Server Not Found error, while http://mysite.com returns 200. I attempted to force non-WWW in the Nginx config file but cannot seem to make anything work. I also restarted Nginx after every attempt.

Here is my current Nginx config file:

server {
listen 80;
server_name mysite.com;
return 301 https://mysite.com$request_uri;
}

server {
listen 443 ssl;
server_name .mysite.com;
root /home/forge/default/current/public;

# FORGE SSL (DO NOT REMOVE!)
ssl_certificate /etc/nginx/ssl/default/56210/server.crt;
ssl_certificate_key /etc/nginx/ssl/default/56210/server.key;

ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

index index.html index.htm index.php;

charset utf-8;

location / {
try_files $uri $uri/ /index.php?$query_string;
}

location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt  { access_log off; log_not_found off; }

access_log off;
error_log  /var/log/nginx/default-error.log error;

error_page 404 /index.php;

location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}

location ~ /\.ht {
deny all;
}
}

8th January, 2016

opheliadesign left a reply on Laravel 5.2 - Changed File List? • 1 year ago

@bashy Laracasts?

opheliadesign left a reply on [Laravel 5] Modify Input Before Validation • 1 year ago

With Laravel 5.2.7 the all() method does not seem to be adding the new fields to validation.

For example:

public function all()
    {
        $input = parent::all();

        $input['title'] = ucwords($input['title']);
        $input['slug'] = str_slug($input['title']);

        return $input;
    }

public function rules()
    {
       return ['title' => 'required', 'slug' => 'unique:topics',  'description' => 'required']; // Slug is not visible to this
    }

7th January, 2016

opheliadesign left a reply on Laravel 5.2 - Changed File List? • 1 year ago

@bashy thanks a bunch for that resource! Awesome!

6th January, 2016

opheliadesign left a reply on Where Are You All From? • 1 year ago

Near the mouth of the Potomac River and Chesapeake Bay in beautiful Virginia, USA :)

4th January, 2016

opheliadesign left a reply on ElasticSearch Integration With Laravel 5.1 • 1 year ago

I'm curious about this, too.. the tutorial looks great but it's huge and mentions Laravel 4.2 at the top. Has anyone successfully used this with 5.2? Figured it was best to ask before diving in.

1st January, 2016

opheliadesign left a reply on Forge Offline • 1 year ago

@IsaacBen If you can SSH into your server, you'll at least be able to access files and maybe do a Git pull. But if you use Envoyer, keep in mind how it sets up directories and symlinks.

Too bad Taylor's 2016 has to begin like this :/

opheliadesign left a reply on Deployment Using Git • 1 year ago

@ejdelmonico .. except for today! LOL Argh

30th December, 2015

opheliadesign left a reply on Vue And Countdown Timer • 1 year ago

Possibly a cron job?

27th December, 2015

26th December, 2015

opheliadesign left a reply on Hey Guys, Newbie Here! Quick Question For Ya.i • 1 year ago

@jwavess it's a best practice to keep things like encryption and API keys out of version control to avoid accidentally revealing them to the public (think open source). So, by default, .env is in your .gitignore file.

And no, there's nothing wrong with running that artisan command, that's what you are supposed to do. Basically, wherever you see env('something', 'orSomething'), the first is the key in your .env file and the second is a default if that key value pair isn't present.

opheliadesign left a reply on Check If Step Is Done • 1 year ago

I'd typically use sessions for something like this..

24th December, 2015

opheliadesign left a reply on Laravel 5.2 - Changed File List? • 1 year ago

@ohffs amen! LOL

opheliadesign left a reply on Laravel 5.2 - Changed File List? • 1 year ago

@mmonkey yeah but still.. when you read an "upgrade guide" I think there is some degree of expectation that it will include the information you need in order to... well, upgrade. If nothing else, maybe a note that says to go compare the changes on Github so that you know that there is more to it.

Just my two cents.. :)

opheliadesign left a reply on Laravel 5.2 - Changed File List? • 1 year ago

@mmonkey thanks, that's really helpful - I do not use Github all that often for this sort of thing, figured I was missing it somewhere.

It would be great if upgrade guides and release notes included more of the actual changes to the framework.

opheliadesign started a new conversation Laravel 5.2 - Changed File List? • 1 year ago

Hi everyone,

As with the Laravel 5.1 upgrade, I am finding out that there are changes to the framework that are not referenced in the upgrade guide, such as the following in App\Http\Kernal

    /**
     * The application's route middleware groups.
     *
     * @var array
     */
    protected $middlewareGroups = [
        'web' => [
            \App\Http\Middleware\EncryptCookies::class,
            \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
            \Illuminate\Session\Middleware\StartSession::class,
            \Illuminate\View\Middleware\ShareErrorsFromSession::class,
            \App\Http\Middleware\VerifyCsrfToken::class,
        ],
        'api' => [
            'throttle:60,1',
        ],
    ];

While these changes probably won't make a huge difference, I'd like for my 5.1 app to be fully upgraded to 5.2. Is there a quick listing of changes like this? I have read the release notes and upgrade guide.

21st December, 2015

opheliadesign left a reply on Greetings To Everyone... • 1 year ago

Um okay hi :)

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.