spaceemotion

spaceemotion

Member Since 5 Years Ago

Experience Points 11,260
Experience Level 3

3,740 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed 167
Lessons
Completed
Best Reply Awards 0
Best Reply
Awards
  • start-engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

21 Jan
1 year ago

spaceemotion left a reply on Passing Custom Parameters For SparkPost API Call

Even though this might be an old topic, I finally figured out a solution today on how to do this with both, the SMTP and API integration for SparkPost and put it in a package:

https://github.com/spaceemotion/laravel-sparkpost-options.

22 Sep
2 years ago

spaceemotion started a new conversation Getting 500 Error When Application Is Set To "down"

After updating one of my applications today, I noticed that I'm getting 500 errors with a pure blank page (yes, storage is writable) and figured out that that only happens when i used the "artisan down" command. The application works perfectly fine otherwise.

Expected behaviour would be displaying the "We'll be back soon" page, but instead my users are presented with a blank page.

I already cleared all laravel and composer caches, and even tried reverting the changes to the pre-update state, but the error just won't go away. We're still on laravel 5.1 (5.1.44 specifically), so this might have been fixed in the future.

Many thanks in advance!

17 Apr
4 years ago

spaceemotion left a reply on Running The Queue From Scheduler

@toniperic Thanks for the tip, but the system needs to run automatically. I did found a solution using screen though. Works not as nice as with supervisor, but as long as there are no errors I'm happy.

Changing the hosting provider - sadly! - is not an option, and they certainly won't install software requested by clients :/ But I'm happy with the almost-"perfect" solution as it is.

Cheers!

spaceemotion left a reply on Running The Queue From Scheduler

@toniperic Hey, thanks for the answer.

Sadly, my client's server does not allow installing any additional hardware (I have ssh access, but its a managed server package).

Even something like supervisor cannot be installed. How can I still listen to all my queues? The only "async" way I have is through cronjobs - in this case the laravel scheduler.

Thanks in advance!

spaceemotion started a new conversation Running The Queue From Scheduler

Is there a way to execute all remaining queues whenever the scheduler runs? I am using the database queue driver and I would like to have my queues "listened" every minute.

Thanks in advance!

01 Apr
4 years ago

spaceemotion started a new conversation XDebug + Homestead + PhpStorm + Artisan Command

I am currently having some trouble setting up XDebug with Homestead and PHPStorm when using an artisan command.

To launch my "application" I am entering the command via SSH in my terminal, but when I want to debug my applicatio,n I usually have to "start it" out of PhpStorm.

How would I go about this when I want to debug an artisan command?

Additionally, vagrant is giving me a hard time making the connection between PhpStorm and Homestead work. It seems like vagrant is not detecting if my homestead machine runs or not… it always says "not created (virtualbox)" when I'm cd'ing into its directory, but global-status reports its running: terminal

13 Mar
4 years ago

spaceemotion left a reply on Long Boot-time With Homestead In Laravel 5

Okay, I finally fixed this by changing my Homestead.yml to this:

folders:
    - map: ~/Development/Websites
      to: /home/vagrant/www
      type: nfs  <-- This is important

After that, just do a homestead halt, homestead provision and homestead up. That should be it!

If NFS should give you errors, this might be helpful: https://coderwall.com/p/uaohzg/use-nfs-to-speed-up-your-vagrant

spaceemotion started a new conversation Elixir: Watch And Minify Scripts Task

For my current project I need to have separate javascript files for backend and frontend (multiple ones for each section), plus the general "app.js" that contains global logic, and some backbone, underscore and jquery stuff.

Since I don't want to slow down the site for users that have no access to the backend, I don't want to combine all my code into that one "app.js".

Is there a way to just copy-minify and watch a folder instead of merging the files together?

Thanks in advance!

03 Mar
4 years ago

spaceemotion left a reply on L5 User Role Middlewares

@radbonev Hey, thanks for the tip. I am actually using the Sentinel Package by Cartalyst.

Looking through the code of the package you linked me, it is using the route information provided through the routes.php. However, I am only using Route::resource and Route::resource, so I have no way to add additional data, or am I wrong?

spaceemotion started a new conversation L5 User Role Middlewares

Is there a way to dynamically create middlewares, or pass on parameters to a middleware?

I would like to have middlewares to check against different user roles, but so far I would only create individual files for each user role that I currently can think of.

Is there an easier way?

spaceemotion left a reply on Check If A Relationship Already Exists

I knew there was a better way ;) I just forgot what it was, even though I just recently watched @JeffreyWay talked about that in one of his videos...

Cheers!

spaceemotion started a new conversation Check If A Relationship Already Exists

I am currently having trouble with duplicate PRIMARY keys.

[Illuminate\Database\QueryException]
  SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '132-118' for key 'PRIMARY' (SQL: insert into `edu_semester_student` (`semester_id`, `student_id`) values (132, 118))

I already have anisset() check in place, but it doesn't seem to work either:

$semester = $course->subject->semester;
if (!$semester->students->contains($student))
{
    $semester->students()->attach($student);
}

My problem is that seems like it still wants to attach the student, even though I thought I checked for that.

Is there a better way to only attach if it doesn't exist yet?

02 Mar
4 years ago

spaceemotion left a reply on Long Boot-time With Homestead In Laravel 5

I am using the default Laravel Homestead box. So the Vagrantfile I am using is this one: https://github.com/laravel/homestead/blob/master/Vagrantfile

spaceemotion left a reply on Long Boot-time With Homestead In Laravel 5

No, I have a mid-2014 MBP with 2,8 Ghz i7. So generally this should be really fast. Normal php sites are taking only 2ms load time maximum (just an empty "hello world"). That's why it's so strange to me…

spaceemotion started a new conversation Long Boot-time With Homestead In Laravel 5

I'm currently making a new laravel-app and use homestead as my local server. However, the application boot time seems really off. Even when I just had a normal, clean Laravel-5 installation it wasn't that much better. I am always between 1-2s for a single site load. Doing a few ajax-requests here and there, it seems like it's taking forever.

This is a Debugbar-Screenshot of my current application: Debugbar

Even 20 database queries only take up to 5ms in total. For my service providers I only used Debugbar, Sentinel, Bugsnag and HashIds - so nothing too mayor. Even when I had Bugsnag turned off the boot-time was almost the same; very slow.

Running artisan optimize and route:cache did not help with the loading time at all (even though I am using a lot of route controllers, which should have slowed things down).

Any ideas? Cheers!

01 Mar
4 years ago

spaceemotion left a reply on Slow Performance, Slow Boot Time

I also have a similar problem like this, although I am only using a local homestead installation:

Debugbar

Even 20 database queries only take up to 5ms in total. For my service providers I only used Debugbar, Sentinel, Bugsnag and HashIds - so nothing too mayor. Even when I had Bugsnag turned off the boot-time was almost the same; very slow.

Running artisan optimize and route:cache did not help with the loading time at all Any ideas?

31 Jan
4 years ago

spaceemotion left a reply on Searching For A Randomly Generated Profile Service (placeholder)

@RachidLaasri This was actually for a non-laravel project / mockup. Before I wanted to go ahead and make a "big" laravel setup, I started with a plain HTML+JS mockup first - something quick to show the client. To fill the content I just needed to get some dummy data everytime I refresh the site.

@colourmill huh, I searched for "random profile generator", but I guess I missed the API part :)

28 Jan
4 years ago

spaceemotion left a reply on Searching For A Randomly Generated Profile Service (placeholder)

@colourmill Yes, that's exactly the site I meant. Thanks!

spaceemotion started a new conversation Searching For A Randomly Generated Profile Service (placeholder)

I am currently searching for a specific website that offers an API for random profiles. (as placeholders to be used during development). I remember the website having a demo section at the top, with clickable buttons that reveal contact information, email and more. A reload would create a new, random profile

It was a completely free service (not like http://randomprofile.com/), but I sadly can't remember where I found it - and it seems like I didn't create a bookmark back then either.

Maybe some of you knows about such a website?

29 Sep
4 years ago

spaceemotion left a reply on Auth Attempt Using Student Number Or Username

You could try to parse the "username" with Regex first, and then use the username or student ID fields depending on your results.

26 Aug
4 years ago

spaceemotion left a reply on PHP's "compact" - Pros And Cons

@daveyoi - coming from CI myself I also can relate with that. I quite like the freedom of laravel though (You can use the array or the withKey($value) syntax). I personally use my suggested method as stated the first post, but I guess it really is just personal preference.

I just wanted to know if there'd be significant differences in speed, etc. ;)

spaceemotion started a new conversation PHP's "compact" - Pros And Cons

I was looking through some code the other day and saw yet another laravel library / project that used "compact" almost everywhere when it was sending data over to the view.

My question is: What are the pros and cons of using compact in the following situation? Isn't it just faster to use the variables directly?

public function index($id)
    {
        $category = Category::find($id);
        $topics = $category->getTopicPaginator();
        $message = Message::find(1);

        // here I would just use "->with([$category, $topics, $message])"
        return View::make('category.index')->with(compact('category', 'topics', 'message'));
    }

Thanks in advance!