francois

francois

Paris

Hire Me

Member Since 5 Years Ago

Experience Points 31,655
Experience
Level
Lessons Completed 374
Lessons
Completed
Best Reply Awards 0
Best Answer
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

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

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

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

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    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 Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

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

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

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

11 Jan
10 months ago

francois started a new conversation Redis Cashing Issue With ::remember

Hello,

I have this kind of code :

<?php
$response = \Cache::remember($this->context->context->id . 'instagram', 1440, function () {
                $data = $this->instagramScraper->make($this->context->context->socials['instagram']);
                return $this->instagramTransformer->transformCollection($data);
            });
return $this->respond($response);

Cache key is created on redis, and values are correct, but the callback is executed every single time. I say this because my API endpoint is responding in more than 3s.

Thanks

01 Aug
1 year ago

francois started a new conversation [5.4] The Payload Is Invalid : DecryptException On Session

  • Laravel Version: 5.4.*
  • PHP Version: 5.6 & 7.1

Description:

I've upgraded 2 Laravel applications on 5.4 few months ago.

Those application were created on 5.1, and I've always follow the upgrade guide 1 month after any major release.

Since 5.4, I often have this kind of error on POST/PUT request :

Illuminate\Contracts\Encryption\DecryptException·The payload is invalid

app/Http/Middleware/CheckForMaintenanceMode.php:43 App\Http\Middleware\CheckForMaintenanceMode::handle  
             throw new HttpException(503);
        }
        return $next($request); //line 43
    }
}

This is the actual code for this middleware :

namespace App\Http\Middleware;

use Closure;
use Illuminate\Foundation\Application;
use Symfony\Component\HttpKernel\Exception\HttpException;

class CheckForMaintenanceMode
{

    /**
     * @var Application
     */
    protected $app;

    public function __construct(Application $app)
    {
        $this->app = $app;
    }

    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request $request
     * @param  \Closure $next
     * @return mixed
     * @throws HttpException
     */
    public function handle($request, Closure $next)
    {
        if ($this->app->isDownForMaintenance()&&
            !in_array($request->ip(),])) {
            throw new HttpException(503);
        }

        if (!is_null($this->app->context->context)
            && $this->app->context->maintenance == true
            && !in_array($request->ip(), [])) {
            throw new HttpException(503);
        }

        return $next($request);
    }
}

Steps To Reproduce:

On those applications, there is around 5000 unique users per day. It happened around 300 times in the last 2 months. I've never find a way to reproduce it. I'm using bugsnag with the last laravel lib version, and this has been introduced with 5.4.

There was no server change when this issue appears the first time, and I don't use encrypt() or decrypt() directly, it's related to the session. The session driver is file on both applications.

I had the issue with php 5.6 on Debian 8, and still have it with php 7.1 on Debian 9.

The only one place where this exception is thrown is in the Encrypter class, getJsonPayload() method.

Middleware configuration:

protected $middleware = [
        \App\Http\Middleware\CheckForMaintenanceMode::class,
        \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
        \App\Http\Middleware\TrimStrings::class,
        \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
    ];

    /**
     * The application's route middleware groups.
     *
     * @var array
     */
    protected $middlewareGroups = [
        'web' => [
            
            \App\Http\Middleware\EncryptCookies::class,
            \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
            \Illuminate\Session\Middleware\StartSession::class,
            \Illuminate\View\Middleware\ShareErrorsFromSession::class,
            \App\Http\Middleware\VerifyCsrfToken::class,
            \Illuminate\Routing\Middleware\SubstituteBindings::class,
        ],

        'api' => [
            'throttle:60,1',
            'bindings',
        ],
    ];
12 Jun
1 year ago

francois started a new conversation The Payload Is Invalid

Hello,

I've upgraded 2 laravel applications on 5.4 few months ago.

Those application were created on 5.1, and I've always follow the upgrade guide 1 month after any release publication.

Since 5.4, I often have this kind of error on POST request :


Illuminate\Contracts\Encryption\DecryptException·The payload is invalid

app/Http/Middleware/CheckForMaintenanceMode.php:43App\Http\Middleware\CheckForMaintenanceMode::handle   
             throw new HttpException(503);
        }
        return $next($request); //line 43
    }
}

I don't have it on webhook notifications, it's always made by user request (session modification, on entity modification, etc).

Thanks

19 May
1 year ago

francois left a reply on TokenMismatchException In Handler, Sometimes Ignored

Hi folks, I still have the issue there, so if you have any idea, feel free to share it ;)

28 Apr
1 year ago

francois left a reply on Why Forge Is So Unsecured ?

@fideloper Just to be clear. When I posted this, it wasn't to say "THIS IS BAD AND EVERYTHING IS BURNING".

Since this post, I'm always using Forge for some applications. It's a really great tool, and I will continue to use it in the future.

It was a question, to understand the reason, and open the conversation to find a better way to do this, if there is an existing one !

With that in mind, I totally disagree your A) point (I may be wrong) : I know it's a problem, but open your permissions, and let someone scale your server access is an important decision. But, I totally agree your B) point, where this actually solve a bigger security problem.

Thanks for your website, I already know it ;)

03 Apr
1 year ago

francois started a new conversation TokenMismatchException In Handler, Sometimes Ignored

Hi folks,

I have a very strange behavior in my app. I've added a custom way to respond on a TokenMismatchException. This works most of the time, but sometimes users have the default woops page for all 500 errors.

From what I can see, it's only on mobile (98% on IPhone). I know it's not related, but I just don't understand how the error can be reported, becausee it has to ba catched by the Handler.

Here is the handler code :

/**
     * Render an exception into an HTTP response.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Exception  $e
     * @return \Illuminate\Http\Response
     */
    public function render($request, Exception $e)
    {
        if ($e instanceof TokenMismatchException) {
            if ($request->expectsJson()) {
                return new JsonResponse(['session' => 'custom message'], 422);
            }
            return back()->withErrors(['session' => 'custom message']);

        }

        return parent::render($request, $e);
    }

And a complet stacktrace :

[2017-04-01 09:47:41] production.ERROR: exception 'Illuminate\Session\TokenMismatchException' in /my_dir/bootstrap/cache/compiled.php:3314
Stack trace:
#0 /my_dir/bootstrap/cache/compiled.php(10069): Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle(Object(Illuminate\Http\Request), Object(Closure))
#1 /my_dir/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(33): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#2 /my_dir/bootstrap/cache/compiled.php(13749): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#3 /my_dir/bootstrap/cache/compiled.php(10069): Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#4 /my_dir/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(33): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#5 /my_dir/bootstrap/cache/compiled.php(12155): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#6 /my_dir/bootstrap/cache/compiled.php(10069): Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#7 /my_dir/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(33): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#8 /my_dir/bootstrap/cache/compiled.php(13495): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#9 /my_dir/bootstrap/cache/compiled.php(10069): Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(Object(Illuminate\Http\Request), Object(Closure))
#10 /my_dir/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(33): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#11 /my_dir/bootstrap/cache/compiled.php(13432): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#12 /my_dir/bootstrap/cache/compiled.php(10069): Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure))
#13 /my_dir/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(33): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#14 /my_dir/bootstrap/cache/compiled.php(10054): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#15 /my_dir/bootstrap/cache/compiled.php(8356): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#16 /my_dir/bootstrap/cache/compiled.php(8347): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#17 /my_dir/bootstrap/cache/compiled.php(8338): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#18 /my_dir/bootstrap/cache/compiled.php(2575): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#19 /my_dir/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request))
#20 /my_dir/vendor/rikless/laravel-caffeine/src/Http/Middleware/LaravelCaffeineDripMiddleware.php(17): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#21 /my_dir/bootstrap/cache/compiled.php(10069): GeneaLabs\LaravelCaffeine\Http\Middleware\LaravelCaffeineDripMiddleware->handle(Object(Illuminate\Http\Request), Object(Closure))
#22 /my_dir/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(33): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#23 /my_dir/app/Http/Middleware/CheckForMaintenanceMode.php(43): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#24 /my_dir/bootstrap/cache/compiled.php(10069): App\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))
#25 /my_dir/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(33): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#26 /my_dir/bootstrap/cache/compiled.php(10054): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#27 /my_dir/bootstrap/cache/compiled.php(2519): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#28 /my_dir/bootstrap/cache/compiled.php(2503): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#29 /my_dir/public/index.php(54): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#30 {main}
25 Jan
1 year ago

francois left a reply on DOMException: Failed To Execute 'insertBefore' On 'Node'

Have the same issue, but not found how to solve it.

23 Aug
2 years ago

francois left a reply on Send Mails To A List Of Email With Queue Jobs

You can add this configuration to your supervisor settings :

process_name=%(program_name)s_%(process_num)02d
numprocs=5

where numprocs=5 is the number of process it can run at a time. If your server can support the load, it will send 5 mails at a time (around 5/sec)

francois left a reply on Fail To Pull Git From Envoy Task

I think your "@servers" blade option is missing from the correct username.

@servers(['demo' => '[email protected] -p 22'])

Maybe you've only do this :

@servers(['demo' => 'domain.com'])

so your connexion to the server is made on another server user, and it's public key is not in your account settings.

19 Aug
2 years ago

francois left a reply on 2,3 Time Refresh Show Page Problem, Maybe Session Creation !

Have you juste tried any other session driver ? "file", "cookie", "database", "apc", "memcached", "redis", "array"

24 Jun
2 years ago

francois left a reply on ShouldQueue Don't Report Notice In Laravel.log

I've posted an issue to have more information, but it looks like there is no real issue there. The problem is that when I use another driver, all works fine.

01 Jun
2 years ago

francois started a new conversation ShouldQueue Don't Report Notice In Laravel.log

Hello,

I'm on the last 5.2 laravel version.

My problem is on jobs/listeners. When I use the ShouldQueue interface, and an error of type : trying to get property of non-object, is thrown, nothing appear in the laravel.log file. When I remove the ShouldQueue interface, it's logged in the file.

In both cases, it appears in the failed_jobs table, but when I use the ShouldQueue, I just can't know what's the error to debug my app.

Thanks, François

11 Mar
2 years ago

francois left a reply on Ajax Request And Auth::user()

Maybe it should be interesting to have the error thrown for the 500 response to help you on what's going wrong.

francois left a reply on Auth Redirect Depends On Route

If you open your AuthController, you'll see this property :

protected $redirectTo = '/';

Maybe you should add the __construct() method to call a new method you'll create, that set this value depends on your current scenario

public function __construct()
{
        $this->defineRedirectRoute();
}


public function defineRedirectRoute()
{
        //add you logic here
    $this->redirectTo = $result;
}
09 Mar
2 years ago

francois left a reply on Middleware- View Only Available For Specific Http Request

If you don't use Route::resource, you just have to declare mydomain/view with :

Route::post('view', 'TestController@method');

In that case, if any user try to access it with a GET request, an error will be thrown.

I think you're not on the good way with your "view". The matter is not the view, but the HTTP verb, and the method used to handle the request. Maybe you should dig into REST approche to understand exactly how to use it : http://www.restapitutorial.com/lessons/httpmethods.html

francois left a reply on Php Artisan Doesnt Work [ErrorException] Undefined Offset: 0 In Laravel 5.1

Could you post the complet stack trace of your error ?

You can have it by running this command from your root folder :

tail -f storage/logs/laravel.log -n300

It's often an issue in your routes.php file from my experience.

20 Jan
2 years ago

francois started a new conversation Query On JSON Column With Eloquent + Postgresql

Hello,

I'm happy to use JSON column type. But, what if you need to declare relations, or query your database on a specific key in this type of column ?

There is no documentation, so I'm wondering if it's just possible.

Thanks François

23 Nov
2 years ago

francois left a reply on Sublime Text + Code Sniffer + Laravel

I like how it works, instead of this particular behavior.

Fix on save is useful. Maybe there is a way to ignore some rules ?

francois started a new conversation Sublime Text + Code Sniffer + Laravel

Hello,

I'm using php Code Sniffer with subime text to auto-fix in PSR2 on save.

I don't know why, but in a namespace App, everytime I save the file, I App is renamed to app.

So, I can't use it, and don't find any answer to fix this behavior.

Thanks, François

28 Sep
3 years ago

francois left a reply on Unique Validation Rule

Ok solved. Just seen created_at and error date were the same. Double clic had generated this I thought. I just need to disable button during loading to prevent from double clics.

francois left a reply on Unique Validation Rule

No. In this example, I've just looked up, and the insert was in the exact same case.

francois left a reply on Unique Validation Rule

My db table already contain the email the request is passing. User is just trying to register a second once.

It actually works for most of request, just one on 2000 have this issue

francois started a new conversation Unique Validation Rule

Hello,

I have a request with this rule on L5.1.10 : 'email' => 'required|unique:users,email

But, I can see this in logs : SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '******' for key 'users_email_unique'

How is it possible ? How can I fix this, because I can't reproduce this behavior ?

29 Jun
3 years ago

francois left a reply on MorphTo Magic

Is it a convention for Laravel ? because I don't see anything in the documentation

francois started a new conversation MorphTo Magic

Hello,

On a laracasts lesson, @JeffreyWay build an activity feed.

On this file https://github.com/laracasts/Build-An-Activity-Feed-in-Laravel/blob/master/app/Activity.php there is a morphTo relation.

What I'm wondering is : What determine the correct model (Class) when in this file https://github.com/laracasts/Build-An-Activity-Feed-in-Laravel/blob/master/resources/views/activity/types/created_post.blade.php he use $event->subject->title ?

Thanks

18 May
3 years ago

francois left a reply on Migrations Change() Failure

After this post, https://laracasts.com/discuss/channels/general-discussion/migrations-change-failure/replies/60203 I've deleted records without relations, so yeah, it's solved, Thanks.

francois left a reply on Eager Loading And PHP (not MYSQL) Performance Issue

Yes, really sure.

As I've already mentioned, mysql is not so much used. On another export, where I don't need to use Eloquent relations, the export on the same counted rows is done in less than 1s.

I'm on Apache2.2 and I think it's a part of my performance issue. The point is that Mysql isn't loaded so I really think it's an Eloquent issue.

I think I should dump the query to see time execution when I run it directly in Mysql.

16 May
3 years ago

francois left a reply on Eager Loading And PHP (not MYSQL) Performance Issue

Sure, it's a solution, but I don't thinks it's the easiest to maintain.

15 May
3 years ago

francois left a reply on Eager Loading And PHP (not MYSQL) Performance Issue

So, after deploying code with indexes (migrations) and chunk, I've still won 50% time. So with or without indexes, it's 1min.

francois left a reply on Eager Loading And PHP (not MYSQL) Performance Issue

I'm preparing a migration to test this in production. I have to update all my repositories to include this chunk method when I need it. I'll give a feed back when all of this will deployed.

14 May
3 years ago

francois left a reply on When To Use The Command Bus?

Not sure to repond to your question, but I think Command Bus patern is not really useful. When you read about it it's like magic things, but (if I'm not wrong) you can't attach multiple actions on a command.

In that case, I've switched to the l5 events functionality, where you can attach multiple handlers on 1 event (dispatch multiple actions actually).

So, in a controller, I use an ActionClass Service (in app/Services) and in this service class, I emit event(s), where the application dispatch all handlers.

francois left a reply on Migrations Change() Failure

Some addresses (16) haven't user linked. Now, it works. Thanks

francois left a reply on Migrations Change() Failure

It looks like I just need to clean my database :)

francois left a reply on Migrations Change() Failure

The original is in the 1st post. This is the modified one :

Schema::table('addresses', function(Blueprint $table)
        {
            $table->foreign('id_user')->references('id')->on('users')->change();
            $table->integer('id_user')->unsigned()->change();
        });

francois left a reply on Migrations Change() Failure

Problem is not solved :

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (homestead.#sql-445_39, CONSTRAINT addresses_id_user_foreign FOREIGN KEY (id_user) REFERENCES ps_users (id))

francois left a reply on Migrations Change() Failure

I was thinking I would be able to concatain all changes on one column with a single line.

francois left a reply on Migrations Change() Failure

I have to move the ->unsigned() on another line like so :

$table->foreign('id_user')->references('id')->on('users')->change();

francois left a reply on Migrations Change() Failure

I'm in developement, but I'll can't refresh when I'll be in production

francois left a reply on Migrations Change() Failure

No no, just a prefix.

francois left a reply on Migrations Change() Failure

This is the only migration file in the queue.

francois started a new conversation Migrations Change() Failure

Hello,

On an existing table, I'd like to add foreign key. So, I've created a migration file :

Schema::table('addresses', function(Blueprint $table)
        {
            $table->foreign('id_user')->references('id')->on('users')->unsigned()->change();
            $table->foreign('id_country')->references('id')->on('regions')->unsigned()->change();

        });

But, when I run php artisan migrate, I have this error :

 [Illuminate\Database\QueryException]                                                                                                                                                                      
  SQLSTATE[HY000]: General error: 1005 Can't create table 'homestead.#sql-445_25' (errno: 150) (SQL: alter table `ps_addresses` add constraint addresses_id_user_foreign foreign key (`id_user`) reference  
  s `ps_users` (`id`))                                                                                                                                                                                      
                                                                                                
  [PDOException]                                                                                
  SQLSTATE[HY000]: General error: 1005 Can't create table 'homestead.#sql-445_25' (errno: 150)

My composer.json file include doctrine/dbal so I really don't understand.

Thanks

13 May
3 years ago

francois left a reply on Eager Loading And PHP (not MYSQL) Performance Issue

Exactly, I was testing this.

This reduce request time execution to 1 min. It's always too much but 50% save is really great. Thanks

francois left a reply on Eager Loading And PHP (not MYSQL) Performance Issue

I've updated this :

public function buildCsv($outputName, $data)
    {

        foreach($data as $row)
        {
            $this->insertRow($row);
        }

        return $this->csvManager->output($outputName . '.csv');
    }

to

public function buildCsv($outputName, $data)
    {

        $data->chunk(100, function($rows)
        {
            foreach ($rows as $row)
            {
                $this->insertRow($row);
            }
        });

        return $this->csvManager->output($outputName . '.csv');
    }

But, after these 2 mins (and only after) I got :

production.ERROR: exception 'ErrorException' with message 'array_chunk() expects parameter 3 to be boolean, object given'

francois left a reply on Eager Loading And PHP (not MYSQL) Performance Issue

There is more than 10Go free RAM during process, so I don't think it's a memory issue. CPU is overloaded on the apache process.

Do you really think the foreign keys will have significant impact on request execution ?

I don't really understand how I can use chunk on my request, do you have more explicit example ?

francois started a new conversation Eager Loading And PHP (not MYSQL) Performance Issue

Hello,

I was optimizing an app, where I need to export some data.

There is a query to export around 12 000 rows, but for all rows, there is 3 or 4 relations used.

When I execute the request excluding the relations data, export is build in less than 0.5s. But, when I add this relations (with eager loading, or not) in the export, request take more than 2 min.

I've looked at the server side, and mysql is not really overloaded, but apache is used at 100% on one thread during those 2 mins.

So, I think it's a php/Eloquent issue, and not from the request.

My question is : If a relations is declared in my php application (the Eloquent way), but I have not set the foreign key on the mysql side, may it generate performance issue for Eloquent, where Eloquent needs to test if the relation is set on active record etc ? Because I know I can use indexes, but we work on around 50 000 rows in our tables, so in can't explain this time difference.

Thanks

20 Mar
3 years ago

francois started a new conversation Multiple Gulp Tasks Using Elixir

Hello,

how can I create multiple tasks in a Gulp file, so I can get multiple Elixir tasks, but just when I need it ?

I've tried this, but it doesn't work https://gist.github.com/rikless/154e3797bf80f91ae9be

Thanks

francois left a reply on Production Assets Files

It's a problem because elixir remove previous production files at the begining of the compilation, so during 6 min, no css, no js. That's a problem yes :/

19 Mar
3 years ago

francois left a reply on Production Assets Files

the problem is that I have a multi-domain application, so 1 css by domain, 1 js by domain, and elixir just take more that 6 mins to minify that.

francois left a reply on Production Assets Files

I worked alone, but now, our team is growing and I need a friend to help me out :) That's why I'm asking just now.