Skip to content

Mastering PHP and Laravel

Never stop learning!

Menu

  • LastPass – Are your passwords secure?

Learning

The current state of things

It’s amazing how life gets going in a rhythm, and you get your head down and working so hard, that you sometimes forget to look around (or in this case, write in your blog). Working at a small travel advertising

Kenny March 26, 2020 Javascript, Laravel, Learning, PHP, Programming No Comments Read more

Sorting Associative Arrays in PHP

$arr = [ ‘foo’ => ‘bar’, ‘faz’ => ‘baz’ ]; array_multisort(array_column($arr, ‘value’), SORT_ASC, $arr); You can sort an associative array with one line of code as I did above. As a result, the array becomes sorted by the keys: [

Kenny January 6, 2020January 6, 2020 Learning, PHP, Programming No Comments Read more

WordPress permalinks not working

WordPress permalinks not working? I feel your pain. Read on… Recently, after setting up another virtual host on my Linux server, for a WordPress site, permalinks were not working. Any page other than home was getting a 404 error. I

Kenny January 20, 2019July 8, 2021 Learning, Linux No Comments Read more

Laravel – the difference between all() and get()

When dealing with a model, all()  is a static method. It creates a new query object, and runs get()  on that object get()  is not static, but can be called statically because of a magic method in the Model class.

Kenny October 12, 2018October 6, 2019 Eloquent, Laravel, Learning, Programming No Comments Read more

Laravel Eloquent only()

$fullModel = Model::find(1) // Get model with id 1 $idArray = $fullModel->only(‘id’) // array containing id // this does not work. You’ll get back an empty collection // It is trying to pull the id column off the collection object,

Kenny October 12, 2018March 26, 2020 Eloquent, Laravel, Learning, Programming No Comments Read more
  • « Previous

Archives

Categories

  • iPhone (2)
  • Learning (42)
  • Linux (4)
    • Debian (1)
  • Mac Terminal / Linux (5)
  • Other Stuff (1)
  • Programming (66)
    • .NET (1)
      • C# (1)
    • Java (1)
    • Javascript (6)
      • AngularJS (1)
      • Node.js (2)
    • MySQL (2)
    • Objective C (1)
    • PHP (45)
      • Community (5)
      • Laravel (9)
        • Eloquent (3)
    • SQL (7)
    • Tools (2)
      • PHP Storm (1)
  • Slim Framework (1)
  • Uncategorized (8)
  • WordPress (3)
Copyright © 2022 Mastering PHP and Laravel. All rights reserved. Theme Spacious by ThemeGrill. Powered by: WordPress.