STEREOH

STEREOH

Software Engineer at Intitek.fr/APRR.fr

Member Since 5 Years Ago

Dijon

Experience Points
66,120
Total
Experience

3,880 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
407
Lessons
Completed
Best Reply Awards
46
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.

Level 14
66,120 XP
Sep
18
12 hours ago
Activity icon

Replied to Which Package Development Course Is Good For Laravel?

I'd start with Marcel's course, it covers more ground as it covers PHP packages & then the specifics of Laravel packages. It's a bit older but you can get it for 45% off at the moment.

Aug
11
1 month ago
Activity icon

Started a new Conversation Init A Lib Inside Alpine Component

Hi everyone,

I'm a bit stuck on how I can initialize some lib (Tippy.js in this case) as soon as an element from an alpine "x-for" is rendered.

I figured I would probably have to treat the element as a component to use x-init on it, the problem is how can I access the content I need from the parent component.

<table x-data="transactions()">
   <thead>
      <tr>
         <th>Name</th>
         <th>Type</th>
         <th>Amount</th>
         <th>Comment</th>
         <th>Action</th>
      </tr>
   </thead>
   <tbody>
     <template  x-for="transaction in filteredTransaction">
      <tr>
         <td x-text="transaction.name"></td>
         <td x-text="transaction.type"></td>
         <td x-text="transaction.amount"></td>
         <td>
            <span 
               x-data 
               x-init="tippy($el)" 
               :data-tippy-content="transaction.comment"
            > // Doesn't work obviously because transaction is not available in this scope
            </span>
         </td>
         <td></td>
      </tr>
     </template>
   </tbody>
</table>

I saw some discussion on github but it's not yet implemented in v2 afaik.

What would be a good way of passing the value of "transaction.comment" down to the sub-component , or is there a better way to achieve this ?

Jul
10
2 months ago
Activity icon

Awarded Best Reply on Tips For Getting A Grasp On Laravel MVC?

Practice is, in my opinion and in your situation, the best way to go.

Try making a simple app ( ie: blog ) without following any course at all.

You are going to hit bumps, when it happens, take a brief moment to think, tinker , and if you can't find a solution, try googling your problem ( learning to search on google is an important skill ) or to find a solution in this forum.

Finally more specifically to the birdboard app. Since it's a TDD project you can try "Build a forum with TDD" wich is a bit older but very in-depth course (102 lessons) to keep learning on top of that.

Apr
08
5 months ago
Activity icon

Replied to View Data According To Class And Class Group

$paper = Paper::where([
	['paper_type', 'PaperSolution'], 
	['class', Auth::user()->class]
])->get();

https://laravel.com/docs/7.x/queries#where-clauses

Apr
07
5 months ago
Activity icon

Replied to Php Artisan Serve

not having to use a web server

Activity icon

Replied to Laravel Route Question

To be able to do that :

route('profile', Auth::user());

You must give a name to your route :

Route::get('/profiles/{user}', '[email protected]')->name('profile');
Apr
06
5 months ago
Activity icon

Awarded Best Reply on NULL Value On Attach()

You have this in your User model

    public function schools()
    {
        return $this->belongsToMany(School::class,'school_student','school_id', 'student_user_id');
    }

and this in your Student model

    public function schools()
    {
        return $this->belongsToMany(School::class);
    }

not tested but imo you should specify the keys for the relation as you do in your user model.

EDIT : Or maybe

public function store(\App\Http\Requests\StudentAddSchoolStoreRequest $request)
    {
        $student = new Student();
	// Replace id with user_id
        $student->user_id = auth()->user()->id;
        $school = new School();
  
        $school->id = $request->id;
        $student->schools()->attach($request->id);

        return redirect('school')->with('message', 'Successful update!');
    }
Activity icon

Replied to NULL Value On Attach()

You have this in your User model

    public function schools()
    {
        return $this->belongsToMany(School::class,'school_student','school_id', 'student_user_id');
    }

and this in your Student model

    public function schools()
    {
        return $this->belongsToMany(School::class);
    }

not tested but imo you should specify the keys for the relation as you do in your user model.

EDIT : Or maybe

public function store(\App\Http\Requests\StudentAddSchoolStoreRequest $request)
    {
        $student = new Student();
	// Replace id with user_id
        $student->user_id = auth()->user()->id;
        $school = new School();
  
        $school->id = $request->id;
        $student->schools()->attach($request->id);

        return redirect('school')->with('message', 'Successful update!');
    }
Apr
03
5 months ago
Activity icon

Replied to Detect Every Change On Model

Eloquent offers plenty of events to a model's lifecycle.

https://laravel.com/docs/5.8/eloquent#events

Apr
02
5 months ago
Activity icon

Replied to Tips For Getting A Grasp On Laravel MVC?

Practice is, in my opinion and in your situation, the best way to go.

Try making a simple app ( ie: blog ) without following any course at all.

You are going to hit bumps, when it happens, take a brief moment to think, tinker , and if you can't find a solution, try googling your problem ( learning to search on google is an important skill ) or to find a solution in this forum.

Finally more specifically to the birdboard app. Since it's a TDD project you can try "Build a forum with TDD" wich is a bit older but very in-depth course (102 lessons) to keep learning on top of that.

Mar
31
5 months ago
Activity icon

Awarded Best Reply on VS Code Package For Overriding Methods?

Judging by this extension's doc,

https://marketplace.visualstudio.com/items?itemName=k--kato.intellij-idea-keybindings

this is not suported in vscode.

Mar
18
6 months ago
Activity icon

Awarded Best Reply on Multiple Bootstrap Radios Do Not Work With Laravel

That's not how Radios work.

<form action="{{ action('[email protected]_data') }}" method="POST">
  @csrf
    <div class="btn-group btn-group-toggle" data-toggle="buttons">
      <label class="btn btn-primary form-check-label">
        <input class="form-check-input" type="radio" name="type_of_cleaning" value="window" checked>
        Window Cleaning
      </label>
      <label class="btn btn-primary form-check-label">
        <input class="form-check-input" type="radio" name="type_of_cleaning" value="room" > Room Cleaning
      </label>
 
    </div>
    <h1>How many times cleaning</h1>

    <div class="btn-group btn-group-toggle" data-toggle="buttons">
      <label class="btn btn-primary form-check-label">
        <input class="form-check-input" type="radio" name="cleaning_times" value="weekly"  checked>
        Weekly
      </label>
      <label class="btn btn-primary form-check-label">
        <input class="form-check-input" type="radio" name="cleaning_times" value="monthly" > Monthly
      </label>
 
    </div>
    <br>
    <br>
    <br>
    <input class="btn btn-danger" type="submit">
</form>
    public function index(){


        return view('pages/index');
    }
    public function get_data(){
        $db = new PagesModel;
        $db->type_of_cleaning = request('type_of_cleaning');
        $db->cleaning_times = request('cleaning_times');
        $db->save();
       
        

        return redirect('/')->with('success', 'thank you');
    }
}

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/radio

Activity icon

Replied to Multiple Bootstrap Radios Do Not Work With Laravel

That's not how Radios work.

<form action="{{ action('[email protected]_data') }}" method="POST">
  @csrf
    <div class="btn-group btn-group-toggle" data-toggle="buttons">
      <label class="btn btn-primary form-check-label">
        <input class="form-check-input" type="radio" name="type_of_cleaning" value="window" checked>
        Window Cleaning
      </label>
      <label class="btn btn-primary form-check-label">
        <input class="form-check-input" type="radio" name="type_of_cleaning" value="room" > Room Cleaning
      </label>
 
    </div>
    <h1>How many times cleaning</h1>

    <div class="btn-group btn-group-toggle" data-toggle="buttons">
      <label class="btn btn-primary form-check-label">
        <input class="form-check-input" type="radio" name="cleaning_times" value="weekly"  checked>
        Weekly
      </label>
      <label class="btn btn-primary form-check-label">
        <input class="form-check-input" type="radio" name="cleaning_times" value="monthly" > Monthly
      </label>
 
    </div>
    <br>
    <br>
    <br>
    <input class="btn btn-danger" type="submit">
</form>
    public function index(){


        return view('pages/index');
    }
    public function get_data(){
        $db = new PagesModel;
        $db->type_of_cleaning = request('type_of_cleaning');
        $db->cleaning_times = request('cleaning_times');
        $db->save();
       
        

        return redirect('/')->with('success', 'thank you');
    }
}

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/radio

Mar
17
6 months ago
Activity icon

Replied to How To Make Option Without Value For Query, To Show Me All Tickets?

you can always add an empty option like that.

<option value="">All</option>

and this should work with your controller code

Activity icon

Awarded Best Reply on LoginController Login Method Redirect

you forgot to return the result of testRedirect() in your login method

Activity icon

Replied to LoginController Login Method Redirect

you forgot to return the result of testRedirect() in your login method

Activity icon

Replied to Design Registration System

What are those nullable fields you're talking about ? ( just for example )

Activity icon

Awarded Best Reply on How To Make Unique Field To Normal Field ?

Run this command.

php artisan make:migration drop_unique_key_on_nid_in_YOUR_TABLE --table=YOUR_TABLE

and in your newly created drop_unique_key_on_nid_in_YOUR_TABLE.php file in database/migrations

<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class Test extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('YOUT_TABLE', function (Blueprint $table) {
            $table->dropUnique('YOUR_TABLE_nid_unique');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('YOUR_TABLE', function (Blueprint $table) {
            $table->unique('nid');
        });
    }
}

Just replace YOUR_TABLE with the name of your table.

Dropping a unique key will not alter your data. I wrote the down function but it will not work if your data is not unique so be careful.

Activity icon

Replied to How To Make Unique Field To Normal Field ?

Run this command.

php artisan make:migration drop_unique_key_on_nid_in_YOUR_TABLE --table=YOUR_TABLE

and in your newly created drop_unique_key_on_nid_in_YOUR_TABLE.php file in database/migrations

<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class Test extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('YOUT_TABLE', function (Blueprint $table) {
            $table->dropUnique('YOUR_TABLE_nid_unique');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('YOUR_TABLE', function (Blueprint $table) {
            $table->unique('nid');
        });
    }
}

Just replace YOUR_TABLE with the name of your table.

Dropping a unique key will not alter your data. I wrote the down function but it will not work if your data is not unique so be careful.

Mar
13
6 months ago
Activity icon

Replied to Query Relationship Existance With Scope

exists() generates a request with a SELECT EXISTS( your query) , this should not load all of your results AFAIK.

If you are not convinced, you can always do :

$this->reports()->activeReports()->take(1)->exists();
Activity icon

Awarded Best Reply on Override The Email Notification For Verifying Email

use Illuminate\Auth\Notifications\VerifyEmail;

You did not import it so it's searching VerifyEmail in App\Providers

Activity icon

Replied to Blade, Set Input Value To Old(), $user Or Empty

I was under the assumption that your form was behind an auth middleware.

If it isn't the case you should test if you have an auth user.

$company_name = Auth::check() ? Auth::user()->company_name : '';
Activity icon

Replied to Blade, Set Input Value To Old(), $user Or Empty

If default is null and you don't have an old vaue , the input will be empty.

Activity icon

Awarded Best Reply on Blade, Set Input Value To Old(), $user Or Empty

old() has a default value.

so

<input type="text" class="form-control" name="company_name" value="{{ old('company_name', Auth::user()->company_name) }}">
Activity icon

Replied to Blade, Set Input Value To Old(), $user Or Empty

old() has a default value.

so

<input type="text" class="form-control" name="company_name" value="{{ old('company_name', Auth::user()->company_name) }}">
Activity icon

Replied to Override The Email Notification For Verifying Email

use Illuminate\Auth\Notifications\VerifyEmail;

You did not import it so it's searching VerifyEmail in App\Providers