JMarcher

JMarcher

Senior Developer at OUTRIGHT Vision GmbH

Member Since 4 Years Ago

Cologne

Experience Points
69,920
Total
Experience

80 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
675
Lessons
Completed
Best Reply Awards
2
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 14
69,920 XP
Feb
11
8 months ago
Activity icon

Replied to Laravel 42000 Syntax Error Or Access Voilation 1064 You Have An Error In Sql Syntax

Disable debug on the production server, I can see all the passwords and secret keys

Nov
27
10 months ago
Activity icon

Replied to How To Decrypt Data From Encrypted Database To Show A List?

You could add something like this in your model:


public function getNomeDecryptedAttribute(){
    return decrypt($this->nome);
}

This way you attributes only will be decrypted when needed. If you need all attributes at once, I believe there is no other way around and you need to do it as you did.

May I ask why are you encrypting every single field and then decrypting it back?

Nov
23
10 months ago
Activity icon

Replied to Session Expire Event?

You can extend the SessionManager and overwide the createCacheHandler() method to return your own CacheBasedSessionHandler.

Inside the CacheBasedSessionHandler is where the destroy() method resides, there you should be able to fire an event and then destroy the session.

Aug
15
1 year ago
Activity icon

Replied to How Can I Convert Many Statement Mysql To Laravel Eloquent?

@moses Look we are not here to do your homework.

I do not want to sound aggressive but you seem to want the answer served on a plate....

Feb
21
1 year ago
Activity icon

Replied to Abandoned Package

You just need to use any version > 2.2.0

Jan
19
1 year ago
Activity icon

Replied to SWITCH TO LINUX

I personally use Manjaro using it since years and have no complains about it.

Aug
18
2 years ago
Activity icon

Replied to Laravel Artisan Commands From Route Times Out

You should do that on a job.

Check your .env file and make sure that your queue driver is not sync, if you do not want jobs to be dispatched directly in the request

Activity icon

Replied to Laravel Artisan Commands From Route Times Out

$stats = Stat::where('userid', $user->id)->first(); gets executed for each user, it seems like your model is missing a relationship.

Your user model could have a hasMany relationship between Stat and you will reduce your number of queries notoriously if you do something like:

$users = User::with('stats')->get();

Activity icon

Replied to Join Two Tables

Laravel has Lazy loading for relationships , to use eager loading we need to use the with() method.

In your case what you want to do is apply some conditions on a relationship that your model has (note wording) that is why you can use whereHas() to apply some conditions on the relationship.

Activity icon

Replied to Join Two Tables

That is wrong, you should be doing something like:

$addresses = Address::whereHas('linked_addresses',function($query) use($single_mixing){
$query->where('code', '!=', $single_mixing->code);
})->get();
Apr
05
2 years ago
Activity icon

Replied to Making API Routes Stateful

APIs are by nature stateless, you can achieve the behaviour you want by using API Tokens, that references one user, state or action in your application.

Dec
07
2 years ago
Activity icon

Replied to Nested Eager Loading

Something like

$post = Post::with(['comments' => function ($query) { $query->orderBy('created_at', 'desc'); },'comments.owner'])->find($id);
Nov
23
2 years ago
Activity icon

Replied to Github Synchronisation Issue

Github released Gitkraken it looks like a great multi-platform tool to do the job

I personally do not use any tools, and resolve the conflicts my self with a text editor and use command line to merge.

Nov
15
2 years ago
Activity icon

Replied to Github Synchronisation Issue

That's kinda part of the job, to resolve conflicts, ideal is that if you are in a team, your team members do not edit the same files as you but if that happens you need to resolve the conflicts if any.

There are several tools to make this a little bit easier

Aug
17
3 years ago
Activity icon

Replied to About JSON Errors Response

Don't be intimidated by Transformers, you can maybe start with an ErrorTransformer like this:

<?php

class ErrorTransformer {
    public function transform($errors)
    {
        return [
                    'success' => false,
                    'errors' => $this->transformErrors($errors)
                ];
    }
    protected function transformErrors($errors)
    {
         // Transform the errors as you want
    }
}

but take note that the MessageBag has errors and errors can contain a list of values in it

Aug
08
3 years ago
Activity icon

Replied to Get Real IP Address

If you are under the same WiFi you will always have the same public IP

Aug
05
3 years ago
Activity icon

Replied to 5.3 Ready For Production?

Taylor also twitted that it will be released in a couple of weeks: https://twitter.com/taylorotwell/status/760954553948774400

Jul
16
3 years ago
Activity icon

Replied to Any Way To Clean Up My BlogController ?

@alanaasmaa Just a Trait with the methods you need, lets say for example: getCategories() and you either retrieve them from your database or from your cache.

Jul
15
3 years ago
Activity icon

Replied to Any Way To Clean Up My BlogController ?

just because you use tags and categories in every request in your controller, I would create a ModelCache trait, so you don't query your database each time to retrieve them.

Jun
26
3 years ago
Activity icon

Replied to Forcing HTTPS Routes On Laravel 5.2

I use a Middleware here is mine:

<?php

namespace Demi\Http\Middleware;

use App;
use Closure;
use Illuminate\Http\Request;
use Redirect;

class ForceSecure
{
    /**
     *
     * @param  \Illuminate\Http\Request $request
     * @param  \Closure                 $next
     * @return mixed
     */
    public function handle(Request $request, Closure $next)
    {
        if (! $request->secure() && App::environment() !== 'local') {
            $request->setTrustedProxies([$request->getClientIp()]);

            return Redirect::secure($request->getRequestUri());
        }

        return $next($request);
    }
}

the line is for CloudFlare:

$request->setTrustedProxies([$request->getClientIp()]);
Jun
20
3 years ago
Activity icon

Replied to How To Add Middleware To Middleware Group Based On Enviroment

@vedmant yes it works, you need to do it like so:

/**
     * Kernel constructor.
     * @param array $middlewareGroups
     */
    public function __construct(Application $app, Router $router)
    {
        $this->app = $app;
        $this->router = $router;
        $this->middlewareGroups['api']=[
            'throttle:1000,2',
        ];
        foreach ($this->middlewareGroups as $key => $middleware) {
            $router->middlewareGroup($key, $middleware);
        }

        foreach ($this->routeMiddleware as $key => $middleware) {
            $router->middleware($key, $middleware);
        }

    }
Activity icon

Replied to How To Add Middleware To Middleware Group Based On Enviroment

On Kernel's __construct()

Just push what you want to $middlewareGroups

Jun
16
3 years ago
Activity icon

Replied to New Spark App Zeitgeber

I just saw to promotional video, I just spotted a typo: Plural for Activity is Activities not Activitys

Jun
15
3 years ago
Activity icon

Replied to Smartest Way To Re-use JSON API Within Blade

If I understood what you want, what you could do is: Use Vue, then, load the models with your Json Data and you can use this to display everything. This has nothing to do with Blade btw

Jun
10
3 years ago
Activity icon

Replied to SPAM Protection?

@JeffreyWay Why not recaptcha? I personally hate email verification (of course only a personal preference) because I need to leave the website and sometimes wait for the email to arrive.

May
30
3 years ago
Activity icon

Replied to Should I Move To A CDN?

The reason that @SaeedPrez points is why CDN is actually the best approach, because cache is your best friend when you need to load a page as quick as possible

May
23
3 years ago
Activity icon

Replied to Storing A New Contact (polymorphic Business/Person)

  • Remove comments and spaces between lines, most of them are redundant
  • By the amount of conditionals in your code, it is clear that this method has to many responsibilities
  • Try to extract some responsibilities to a new Class or if you don't find it necessary into different methods
May
14
3 years ago
Activity icon

Replied to Search Package

Algolia have a free plan that for a starter is pretty good, if you need more records is probably worth it to spend a few dollars in a good search service

Activity icon

Replied to Where Are You All From?

I'm from Montevideo, Uruguay But I live in Paderborn, Germany

Activity icon

Replied to Search Package

I recommend Algolia ( https://www.algolia.com/ ) Super simple and the results are pretty fast.

Really easy to integrate with Laravel

May
13
3 years ago
Activity icon

Replied to Database Tables, Migration, Indexes

I would really consider splitting your Model in a different way, for example

$table->integer('make_id');
            $table->integer('models_id');
            $table->integer('color_id');
            $table->integer('fuel_id');
            $table->dateTime('yearOfManufacture');
            $table->integer('cylinder_id');
            $table->integer('emission_id');
            $table->integer('wheels_id');
            $table->integer('weight_id');
            $table->integer('mileage');
            $table->decimal('price', 8, 2);
            $table->string('vin');
            $table->integer('transmission_id');
            $table->integer('typeApproval_id');
            $table->integer('numberOfDoors');
            $table->integer('bodytype_id');

Could be simplified with:

 $table->unsignedInteger('car_id');
$table->foreign('car_id')->references('id')->on('cars')
                ->onUpdate('cascade')->onDelete('cascade');

This way your model will be cleaner, and with this relationship you could do something like $ad->car->price;

Activity icon

Replied to MariaDB Or MySQL?

Yes, until now you can use the same tools you used for MySQL in MariaDB also.

Activity icon

Replied to MariaDB Or MySQL?

This leads always to a personal choice. But I'll always stick with whatever package your operative system supports/maintains/updates better.

May
06
3 years ago
Activity icon

Replied to [Help] Need To Add Image And Text Inside A Json DB Column

Rather than answering your question I'll try to encourage you to change your implementation.

Your implementation violates one of the first principles of database normalization, where "Every row-and-column intersection contains exactly one value from the applicable domain (and nothing else)." -Wikipedia

You may think you don't but storing an array as json in a cell for me kind of does.

In your case I would consider making Image a new Model

Activity icon

Replied to Homestead: Not Working After "El Capitan" Installation

As indicated, did you tried to boot the vagrant image with your VM?

Apr
16
3 years ago
Activity icon

Replied to Non Mantained Laravel Versions Documentation

@jlrdw Dude, do you even read?

There are Laravel versions not maintained anymore, for this versions is mandatory a kind of warning.

Activity icon

Replied to Non Mantained Laravel Versions Documentation

@jlrdw It is not about how smart you are for making 2 clicks

It is about user friendliness.

And also Laravel 4.2 and below are not maintained anymore.

Activity icon

Started a new conversation Non Mantained Laravel Versions Documentation

This is a suggestion for the Laravel Documentation on the website. I realized that when you seach on google for some laravel documentation, most of the times it takes me to the Laravel 4.2 documentation. In my oppinion the user must be adviced to change the documentation version for the recent one.