corbosman

corbosman

Technology Evangelist at XS4ALL

Member Since 4 Years Ago

Amsterdam

Experience Points
71,460
Total
Experience

3,540 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
716
Lessons
Completed
Best Reply Awards
9
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.

Level 15
71,460 XP
Sep
06
1 month ago
Activity icon

Replied to Laravel Problem After Moving To Another System

Did you run "composer install"? The dependencies that are installed with composer are generally not added to a git repo. Look at your .gitignore to see what all got excluded. Another file to check is the .env file, which is also generally not added to git.

Sep
03
1 month ago
Activity icon

Replied to Execute Specific Jobs On Specific Server

You could just do what you suggest and don't worry about optimising until this solution actually becomes a problem. People often dismiss certain solutions because "it wouldn't work on 1000 servers", but they forget that for the foreseeable future, and perhaps never, they won't even remotely hit that barrier.

What's much more important is that you make sure your solution is tested, simple, and easily modified when you do run into limits.

Aug
31
1 month ago
Activity icon

Replied to Running Lumen Inside A Docker Container

It depends on where your postgres server is. If it's somewhere outside of docker it should just work by referencing it as a hostname or ip number.

If it's also a docker container, there are 2 possibilities.

One, you want it to be part of a "grouping" where your php container and postgres container form a set together. If that's the case, use docker-compose. Then you can just use the name of your postgres container as the hostname. It does mean you need to set up a docker-compose config file. Once you get the hang of it this is a very powerful setup.

Or two, if you have a dedicated docker postgres container, you need to allow the 2 containers to see eachother. You do that by creating a docker network and configuring that network on both containers.

Activity icon

Replied to Running Lumen Inside A Docker Container

artisan serve just starts up a php -S, so yes, they are the same.

Activity icon

Replied to Running Lumen Inside A Docker Container

You basically have two choices. Either you use php -s, or you set up a webserver. There is no "production webserver" built into lumen. That's what the apaches/nginxes of this world are for.

You could just use an apache+php image. nginx is a bit harder to set up.

Jul
14
3 months ago
Activity icon

Replied to Multiple Server Workers For A Queue

Probably your only option is to deploy multiple installations of your app to multiple servers and run queue workers on them. It seems like the easiest solution anyways. For docker I do something similar, except it's not multiple worker servers but containers running different parts of laravel (one for queue, one for horizon, etc). It would be trivial to tell docker to simply scale up the queue worker containers.

Jul
13
3 months ago
Activity icon

Replied to Laravel Passport Create Token And Refresh Token

How do you make the token for your user/password method? Can't you do it the exact same way?

Jun
17
4 months ago
Activity icon

Replied to How Would You Handle Delay/conditionnal Notifications ?

Can't you just create the notification the moment the article is actually published? You could even make that automatic with an event listener.

Jun
14
4 months ago
Activity icon

Replied to Model Inheritance

Without knowing why you'd want to do it that way, let me give an alternative. Just have a 'public_transport" table, and then a second table 'types', where each type of public transport has an entry. So $transport->type->name would be 'bus' or however you'd want to do it.

Activity icon

Replied to Multiple People Working On The Same Form, How To Prevent Conflicts?

How you implement this in vue is all up to you. What websockets does is allow you to communicate from a backend (laravel) to a frontend (vue) in realtime. So if a user modifies a form, laravel will broadcast an event to all other vue clients. Those vue clients will receive the event, and can do whatever you want to do with it. That's all up to you.

Activity icon

Replied to How Do You Structure (Folders) Your Project?

I use the same structure as laravel provides out of the box. I make 2 changes.

  1. I dont put models into the app/ folder. In larger apps I think this is very confusing. So generally I make a subfolder under app for models. I happen to call them "Repositories", but you can name it whatever.

  2. I have a Lib folder for functionality that I create in the app but isnt really a core part of the app. In an ideal world id move those to its own composer packages but I dont always get around to it.

Activity icon

Replied to Multiple People Working On The Same Form, How To Prevent Conflicts?

The best way would be to use websockets, which in laravel could be Laravel Echo. You would need a websockets service though. In the past I've used pusher.com, but now I use this repo: https://github.com/beyondcode/laravel-websockets

It's a bit of a learning curve to get things working, but if you want the kind of functionality you're after this is the best approach.

Jun
10
4 months ago
Activity icon

Replied to How To Work Cron Job

Unless your hosting provider provides some kind of UI for it, you don't. If you want to use cron, you need to be able to add those cron jobs to the system.

Activity icon

Replied to How Passport Generate Tokens?

This is done deep in passport and phpleague/oauth2-server. It is not easy to get to. The JWT token is made in oauth2-server here: https://github.com/thephpleague/oauth2-server/blob/master/src/Entities/Traits/AccessTokenTrait.php

Im not sure what you mean with sign a request, but you could absolutely make your own token and pass that around. You could add claims to the token as well. I use this factory class.

<?php

namespace App\Auth;

use Lcobucci\JWT\Builder;
use Lcobucci\JWT\Signer\Key;
use Laravel\Passport\Passport;
use Lcobucci\JWT\Signer\Rsa\Sha256;

class ApiToken
{
    public function make($user)
    {
        return (new Builder())
            ->setId(bin2hex(random_bytes(40)), true)
            ->setIssuedAt(time())
            ->setNotBefore(time())
            ->setExpiration(now()->addDay()->format('X'))
            ->setSubject($user->username)
            ->set('client', $user->token()->client->name)
            ->sign(new Sha256(), new Key('file://'.Passport::keyPath('oauth-private.key'), app('encrypter')->getKey()))
            ->getToken()
            ->getPayload();
    }
}
Activity icon

Replied to Picking Up Implicit Model In Middleware

Assuming your route has {thread}, it will be available as

$request->thread
Activity icon

Replied to How To Use Save() Method In Observer?

Try using something like:

$model->unsetEventDispatcher();
May
22
5 months ago
Activity icon

Replied to Subscribe To Private Channels Pusher

First of all, why not use laravel Echo? It can talk to pusher. https://laravel.com/docs/5.8/broadcasting#installing-laravel-echo.

The csrf token you can pass to JS like so. In the section of your html put this:

<meta name="csrf-token" content="{{ csrf_token() }}">

Then in javascript you can do this.

let token = document.head.querySelector('meta[name="csrf-token"]')
Activity icon

Replied to What Will Be The Future Of Php And Also Laravel In Front Of Node And Other Backend Technologies.

Predicting the future is notoriously uncertain. I wouldn't think about it too much. Things will happen as they happen, just be prepared to go with the flow. When vue first appeared we started using it for small parts of our projects, now we have some apps that are fully run in vue with a laravel api backend. Who knows what tomorrow will bring.