gregghoush

Host at The Gregg Housh Show

Experience

14,220

0 Best Reply Awards

  • Member Since 11 Months Ago
  • 139 Lessons Completed
  • 0 Favorites

7th October, 2017

gregghoush left a reply on Trouble Accessing An Array • 8 months ago

Turns out this is how I get just the array from subtable:

$visits = $visits[0]->subtable;

gregghoush left a reply on Trouble Accessing An Array • 8 months ago

Thanks @ftrillo, typeof tells me its an Array and passing $visits to json_decode says json_decode() expects parameter 1 to be string, array given

gregghoush left a reply on Trouble Accessing An Array • 8 months ago

Hey @Dry7,

Thanks, tried that just now, it gives me this error:

Undefined index: subtable

6th October, 2017

gregghoush started a new conversation Trouble Accessing An Array • 8 months ago

I am attempting to use Rob Brazier's Laravel-Piwik package to grab information from my Piwik install. I have this code to get visits to blog posts in the past week. It gives me an object, which contains an array, which is made up of objects.

        $visits = Piwik::getActions();
        $visits = $visits->getPageUrls(['period' => 'week', 'expanded' => '1', 'segment' => 'pageUrl%3D%5Ehttp%253A%252F%252Ftesting.dev%252Fblog%252F']);
        //$visits = $visits->subtable[0];
        dd($visits);

This works, it gets me the object and the dd shows it to me.

Here is the object it gives me: http://i.imgur.com/2o9TVpi.png

If I uncomment the commented out line there I get this error: Trying to get property "subtable" of non-object.

How do I access that array "subtable"? I would like to loop through it with a foreach.

22nd August, 2017

gregghoush left a reply on Sanity Check On My Deployment, Staging, Production Plan. Is It Good? • 9 months ago

Thanks @MikeHopley. On security I plan on doing all of the standard things: setup the firewall, fail2ban, and 20 other things.

Thanks for the sanity check there. I am going to go forward with this and see how it works out.

gregghoush left a reply on Sanity Check On My Deployment, Staging, Production Plan. Is It Good? • 9 months ago

Thanks for that. Makes sense. And yes, it would be awesome to have more feedback from people who have been through this already.

gregghoush started a new conversation Sanity Check On My Deployment, Staging, Production Plan. Is It Good? • 9 months ago

I am about to put my first Laravel project up. I am still early in development, but I am ready to have some testing, feedback, and all the other good stuff that comes from getting a staging server up. Here is my plan after watching the Envoyer videos, reading a bunch about Forge, and some other basic knowledge.

  1. Use Forge to setup 2 servers on DigitalOcean. One for Production, one for Staging.

  2. Setup HTTP basic auth blocking access to the staging server to unauthorized people. Thanks to Jacob Bennett for a simple solution: https://gistlog.co/JacobBennett/8193e13cef3427fbb88f

  3. Create a "staging" branch for my git repository. Start working in this branch and only merging into master when I am ready for code to go to production.

  4. Setup Envoyer with both servers. Set the production server to deploy automatically from the master branch of my projects github repo.

  5. Setup Envoyer to deploy automatically from the staging branch to my staging server.

  6. Modify the Envoyer deployment for staging by adding a hook to run migrate:fresh -- seed.

  7. Setup different .env files for each server with the proper variables for staging or production.

This would seem to give me:

1 production server automatically deploying from my master branch whenever I push to github. This server would have production values in its .env and only migrate, but not seed when deplying.

1 staging server automatically deploying from my staging branch whenever I push that to github. This server would have staging values in its .env and it would wipe out the database, migrate it from scratch and re-seed it every time.

Am I missing anything here?

11th August, 2017

gregghoush started a new conversation Using A Global Vue Object And Adding More To The Data Array? • 10 months ago

I currently am just defining a new Vue object on every page I do Vue work. I would prefer to define that in my app.js instead. Right now I do this on pages:

@section('scripts') var app = new Vue({ el: '#app', data: { password_options: 'keep' } }); @endsection

I could move that to app.js, but then how would I add in that password_options value to data on "app" from that specific page?

1st August, 2017

gregghoush started a new conversation Subscribe Notification On Signup, Remove On Subscription? • 10 months ago

Starting a new Spark application today. One thing I noticed was that the notification asking people to subscribe is still there as a notification after they actually subscribe.

It feels like that should be replaced with a notification saying thanks for subscribing, once they actually subscribe? or at least removed.

Any thoughts on the best way to go about that?

Initial thought since notifications don't have types is to look for the user_id, icon=fa-clock-o, action_text=Subscribe and delete it. Anything wrong with that?

gregghoush left a reply on Best Admin Dashboard Boilerplate? • 10 months ago

I came here to ask pretty much the same thing and was looking at Clear. Hope some other recommendations come through.

22nd July, 2017

gregghoush left a reply on Always Free Plan (no Trial), But With Possibility To Subscribe To Paid Plans • 10 months ago

I will need this same thing coming up soon. Anyone have a solution to this?

Edit Your Profile
Update

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