dadub

Member Since 2 Years Ago

Experience Points
1,560
Total
Experience

3,440 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
3
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start your 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-in-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 Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist 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.

  • Community Pillar

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

Level 1
1,560 XP
Nov
14
2 months ago
Activity icon

Started a new Conversation Laravel-mix Mandatory To Use ReactJS ?

Hello everyone and thank you in advance for your help.

I have a Laravel 7 project that I will have to integrate ReactJS into.

In fact, in order for my project to display correctly, I have to disable laravel-mix, otherwise the CSS is not loaded (as the console shows you).

In order to work around this issue, I had to disable laravel-mix (/Applications/MAMP/htdocs/overlap_github/myproject/webpack.mix.js) by setting it to false like this:

My question :

Is Laravel-Mix important for me to be able to use ReactJS?

Because I will have to integrate a ReactJS component.

Thank you in advance for your help.

Nov
11
2 months ago
Activity icon

Replied to Table Drag And Drop Vertical And Horizontal

I reply by myself and hope I will help someone :

https://github.com/STRML/react-grid-layout

Take care.

Nov
01
2 months ago
Activity icon

Started a new Conversation Table Drag And Drop Vertical And Horizontal

Hello everyone,

My goal is not to be given something ready-made or to do the work for me.

I am completely desperate.

I'm looking to create a table that would allow me to add classes from one week to the next.

The idea is that we can choose a start time and an end time (vertically drag and drop) and a number of weeks over which the course will be given (horizontally drag and drop) and all this in drag and drop.

I need something like this :

https://www.dropbox.com/s/00240jhtubs85xp/schedule.png?dl=0

Do you have a resource or has someone already developed this kind of project?

I sincerely thank you for the help you will give me.

Sep
18
4 months ago
Activity icon

Started a new Conversation SQL Error With GROUP BY

Hello,

I have this error :

```message "SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'project.hinteractions.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by (SQL: select hinteractions.id as hId, dinteractions.id as dId, hinteractions.notes as hNotes, dinteractions.notes as dNotes, targets.name as targetName, hforce.name as hForce, hforc….id = hinteractions.target_id inner join dinteractions on targets.id = dinteractions.target_id left join forces as hforce on hforce.id = hinteractions.force_id left join forces as dforce on dforce.id = dinteractions.force_id where hinteractions.herb_id = 36 and targets.id = 326 and (targets.target_type_id LIKE 2 or targets.target_type_id LIKE 3) group by hinteractions.notes order by dinteractions.force_id asc, hinteractions.force_id asc)"


After multiple searches, I know the cause of this error is these two lines :

``->groupBy('hinteractions.notes')
->groupBy('hinteractions.notes')

Here is the complete code of the SQL query :

${"result$i"} = DB::table('targets')
                        ->join('hinteractions', 'targets.id', '=', 'hinteractions.target_id')
                        ->join('dinteractions', 'targets.id', '=', 'dinteractions.target_id')
                        ->leftJoin('forces as hforce', 'hforce.id', '=', 'hinteractions.force_id')
                        ->leftJoin('forces as dforce', 'dforce.id', '=', 'dinteractions.force_id')

                        ->select('hinteractions.id as hId', 'dinteractions.id as dId', 'hinteractions.notes as hNotes', 'dinteractions.notes as dNotes', 'targets.name as targetName', 'hforce.name as hForce', 'hforce.color as hColor', 'dforce.name as dForce', 'dforce.color as dColor')
                        ->where('hinteractions.herb_id', $nbrPlantes[$i-1])
                        ->where('targets.id', $request->mechanismId1)
                        ->where(function ($query) {
                            $query->where('targets.target_type_id', 'LIKE' , 2)
                                    ->orWhere('targets.target_type_id', 'LIKE' , 3);
                            })
                        ->groupBy('hinteractions.notes')
                        ->orderBy('dinteractions.force_id', 'ASC')
                        ->orderBy('hinteractions.force_id', 'ASC')
                        ->get();

                    if (isset(${"result$i"}[0]) && !(${"result$i"}[0] == null)) {
                        $truc = ${"result$i"}[0];
                        ${"drug$i"} =  DB::table('drugs')->where('id', $truc->dId)->pluck('name');
                    }
                    else {${"drug$i"} = "";}
                          
                    ${"herb$i"} =  DB::table('herbs')->where('id', $nbrPlantes[$i-1])->pluck('name');
                    $retour['herb'.$i] = ${"herb$i"};
                    $retour['drug'.$i] = ${"drug$i"};
                    $retour['result'.$i] = ${"result$i"};
                    $retour['references'.$i] = ${"references$i"};            
                }
                $mechanism = DB::table('targets')->where('id', $request->mechanismId1)->pluck('name');
                $retour['mechanism'] = $mechanism;
                
            }
            else{ 
                $retour['mode_interaction'] = "multimechanisms"; 
                //Evenor S. pour chaque mechanism faire une requete sql pour avoir les interactions avec une plante
                for ($i=1; $i < $compteurMechanisms; $i++) {

                    ${"references$i"} = DB::table('references')
                        ->join('hinteraction_has_references', 'references.id', '=', 'hinteraction_has_references.reference_id')
                        ->join('dinteraction_has_references', 'references.id', '=', 'dinteraction_has_references.reference_id')
                        ->join('hinteractions', 'hinteractions.id', '=', 'hinteraction_has_references.hinteraction_id')
                        ->join('dinteractions', 'dinteractions.id', '=', 'dinteraction_has_references.dinteraction_id')
                        ->where('hinteractions.herb_id', $request->herbId1)
                        ->where('dinteractions.target_id', $nbrMechanisms[$i-1])
                        ->select('hinteractions.id as hId', 'dinteractions.id as dId', 'references.*')
                        ->get();
                    
                    
                    ${"result$i"} = DB::table('targets')
                        ->join('hinteractions', 'targets.id', '=', 'hinteractions.target_id')
                        ->join('dinteractions', 'targets.id', '=', 'dinteractions.target_id')
                        ->leftJoin('forces as hforce', 'hforce.id', '=', 'hinteractions.force_id')
                        ->leftJoin('forces as dforce', 'dforce.id', '=', 'dinteractions.force_id')

                        ->select('hinteractions.id as hId', 'dinteractions.id as dId', 'hinteractions.notes as hNotes', 'dinteractions.notes as dNotes', 'targets.name as targetName', 'hforce.name as hForce', 'hforce.color as hColor', 'dforce.name as dForce', 'dforce.color as dColor')
                        ->where('hinteractions.herb_id', $request->herbId1)
                        ->where('targets.id', $nbrMechanisms[$i-1])
                        ->where(function ($query) {
                            $query->where('targets.target_type_id', 'LIKE' , 2)
                                    ->orWhere('targets.target_type_id', 'LIKE' , 3);
                            })
                        
                        ->groupBy('hinteractions.notes')
                        ->orderBy('dinteractions.force_id', 'ASC')
                        ->orderBy('hinteractions.force_id', 'ASC')
                        ->get();

Have I to change my code ? Do you have any idea please ?

For information, I change my config database file :

'mysql' => [
            'driver' => 'mysql',
...
'strict' => false,

It still not working, I have to comment my two group by code lines

Thank you in advance for your help.
Aug
26
5 months ago
Activity icon

Started a new Conversation Generate A Schedule With A Table Or Do You Have Another Way ?

Hello everyone and thank you in advance for your help.

I should create a schedule like this, but I think I have two ways to go about it:

1- I generate a table and I merge the rows and columns against the data in my database 2- I am using a Laravel plugin.

But, does such a plugin exist? What would you recommend that I turn a JSON return into a display like the one shown in my Dropbox link?

https://www.dropbox.com/s/aazrmnxe9pvd4bk/Capture%20d%E2%80%99%C3%A9cran%202020-08-26%20%C3%A0%2017.42.20.png?dl=0

Thank you in advance and have a nice day / evening.

Jul
28
5 months ago
Activity icon

Awarded Best Reply on Add OrderBy To A ::with

Hello,

I just want to let you know that I used another way :

@foreach ($herb->hinteractions->sortBy('force_id') as $hinteraction)

I used sortBy in the view....

Thank you agian for your help.

Activity icon

Replied to Add OrderBy To A ::with

Hello,

I just want to let you know that I used another way :

@foreach ($herb->hinteractions->sortBy('force_id') as $hinteraction)

I used sortBy in the view....

Thank you agian for your help.

Jul
25
6 months ago
Activity icon

Replied to Add OrderBy To A ::with

Sorry, I added by mylsef.

But the problem is going on :

Undefined constant 'App\Http\Controllers\herbs'.intelephense(1011)

Activity icon

Replied to Add OrderBy To A ::with

Hello

Thank you, both of you.

I tried this code :

$herb = Herb::with('hinteractions.herbs', 'hinteractions.effects', 'hinteractions.targets');
        ->select(herbs.*)
        ->join('hinteractions as hi', 'hi.herb_id','=','herbs.id')
        ->orderBy('hi.force_id')
        ->findOrFail($id);

syntax error, unexpected '->' (T_OBJECT_OPERATOR) Undefined constant 'App\Http\Controllers\herbs'.intelephense(1011) Peek Problem (⌥F8) No quick fixes available

Thank you again for your help.

Activity icon

Started a new Conversation Add OrderBy To A ::with

Hello and thank you in advance for your help.

I have this code :

$herb = Herb::with('hinteractions.herbs', 'hinteractions.effects', 'hinteractions.targets')->findOrFail($id);

I would like to add orderBy force_id

App\Herb {#1783
  #relations: array:1 [▼
    "hinteractions" => Illuminate\Database\Eloquent\Collection {#1822 ▼
      #items: array:35 [▼
        0 => App\Hinteraction {#1851 ▼
          #table: "hinteractions"
          #attributes: array:9 [▼
            "id" => 157
            "herb_id" => 8
            "target_id" => 2
            "user_id" => 2
            "force_id" => 4
            "validated" => 1
            "created_at" => "2020-07-25 09:24:08"
            "updated_at" => "2020-07-25 09:24:08"
          ]

I tried that :

$herb = Herb::with('hinteractions.herbs', 'hinteractions.effects', 'hinteractions.targets')->orderBy('force_id')->findOrFail($id);

I have this error :

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'force_id' in 'order clause' (SQL: select * from herbs where herbs.id = 8 order by force_id asc limit 1)

Thank you in advance for your help.