manelgavalda

Developer at Cyber-Duck

Member Since 3 Years Ago

Roquetes

Experience Points
239,120
Total
Experience

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
1503
Lessons
Completed
Best Reply Awards
135
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 48
239,120 XP
Nov
05
2 months ago
Activity icon

Replied to Livewire Version Of Vue Dev Tools Or Networ

Hey, If you are already familiar with Vue devtools, you can actually use livewire-devtools: https://github.com/beyondcode/livewire-devtools , as they have the same functionallity

Sep
28
3 months ago
Activity icon

Commented on Comments Component

You can also use $this->post->refresh() to re-hydrate the Post model using fresh data from the database.

Docs: https://laravel.com/docs/8.x/eloquent#retrieving-models

Sep
15
4 months ago
Activity icon

Replied to Form Request Cannot Be Sent Using POST.

I think the /{user} route is overwriting your /create route, you need to change the order:

Route::prefix('users')->group(function () {
        Route::get('/', '[email protected]')->name('admin.users');
        Route::get('/{user}', '[email protected]_user')->name('admin.users.view');
        Route::post('/create', '[email protected]_user')->name('admin.users.create');
        Route::post('/{user}/edit', '[email protected]_user')->name('admin.users.edit');
        Route::post('/{user}/delete', '[email protected]_user')->name('admin.users.delete');
});
Sep
13
4 months ago
Activity icon

Awarded Best Reply on Add A Global Method To All Eloquent Models.

  • You can create another model class with your method inside.
  • Then extend the eloquent model class from it.
  • And finally let all your models extend your custom model class.
// Your custom model.
<?php

namespace App;

use Illuminate\Database\Eloquent\Model as EloquentModel;

class Model extends EloquentModel
{
    public function customMethod()
    {
        //
    }
}

Your models

<?php

namespace App;

class ExampleModel extends Model
{
}
Sep
11
4 months ago
Activity icon

Replied to How To Assert Paginations In Laravel?

I would create 2 categories, and then just make sure that you can only see the first one (because the pagination):

$category1 = factory(Category::class)->create();

$category2 = factory(Category::class)->create();

$response = $this->get(route('categories.index'));

$response
	->assertSee($category1->name)
        ->assertDontSee($category2->name);

Just updated the example with categories.

Sep
10
4 months ago
Activity icon

Awarded Best Reply on PDOExcetion('Could Not Find Driver')

I think you just need to install the dbaldriver now:

composer update
composer require doctrine/dbal
Sep
05
4 months ago
Activity icon

Replied to MIgration Issue

That's weird. I just copied the code, and it's working for me, which MySql version are you using?

Activity icon

Replied to MIgration Issue

You changed the 2 lines and you still have the same problem?

Activity icon

Replied to MIgration Issue

Hey, you have a typo on ->refrences in the 2 foreign lines:

 $table->foreign('contact_user_id')->references('id')->on('contact_users');
Sep
04
4 months ago
Activity icon

Replied to User In Laravel Controllers

Hey, If you want to eager load the relationships everywhere, I would suggest using the $with property in your User model:

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class User extends Model
{
    /**
     * The relationships that should always be loaded.
     *
     * @var array
     */
    protected $with = ['author'];

    /**
     * Get the author that wrote the book.
     */
    public function author()
    {
        return $this->belongsTo('App\Author');
    }
}

Docs: https://laravel.com/docs/7.x/eloquent-relationships#eager-loading

Sep
02
4 months ago
Activity icon

Replied to PDOExcetion('Could Not Find Driver')

I think you just need to install the dbaldriver now:

composer update
composer require doctrine/dbal
Activity icon

Replied to PDOExcetion('Could Not Find Driver')

Are you sure you have the mysql_pdo driver installed? Check your extensions file and make sure that it isn't commented and that it's installed. In your php.ini:

extension=php_pdo_mysql.dll
Activity icon

Replied to Problem With PHPUnit + SQLite DropColumn()

Is the configuration inside .env.testing/.env correct?

Activity icon

Replied to PDOExcetion('Could Not Find Driver')

Hey, maybe you are missing the dbal driver:

composer require doctrine/dbal
Aug
31
4 months ago
Activity icon

Awarded Best Reply on Difference Between Session::get And {!!

I understand now. The redirect with and the view with, don't do the same.

  • The redirect with puts the variable in the session.
  • The view with passes the variable to the view.

You have some options here. Instead of passing the variable to the view, you can put it in the session, so the redirect and the view will work :

// Passing to session and returning the view.
session(['param1' => $param1]);

return view('Page1');
// Passing to session and redirecting.
return Redirect::back()->with('Param1', $Param1);

Then in your javascript access it like:

var Param1={!! Session::get("Param1") ?? '' !!};
Activity icon

Replied to Question About Subsciption

You keep the access for the rest of the month.

Activity icon

Replied to Difference Between Session::get And {!!

I understand now. The redirect with and the view with, don't do the same.

  • The redirect with puts the variable in the session.
  • The view with passes the variable to the view.

You have some options here. Instead of passing the variable to the view, you can put it in the session, so the redirect and the view will work :

// Passing to session and returning the view.
session(['param1' => $param1]);

return view('Page1');
// Passing to session and redirecting.
return Redirect::back()->with('Param1', $Param1);

Then in your javascript access it like:

var Param1={!! Session::get("Param1") ?? '' !!};
Activity icon

Replied to Difference Between Session::get And {!!

Hey, with passes the variable to the view, not to the session, that's why the first option works.

You can also use this to access the variable in your javascript:

var Param1 = @json($Param1);
Aug
15
5 months ago
Activity icon

Replied to How To Prevent Trimming Of Spaces While Creating A Record In Db

That's weird, I don't really know what else to do then, sorry.

Activity icon

Replied to How To Prevent Trimming Of Spaces While Creating A Record In Db

You should put the name of the attribute in this array. In case you don't want to trim the name of the user:

protected $except = [
    'name'
];
Activity icon

Replied to How To Prevent Trimming Of Spaces While Creating A Record In Db

Hey, in the TrimStringsmiddleware there's a property $exceptwhere you can add all the fields you want to save without being trimmed. If you want to do this for all the fields you can remove the TrimStrings middleware from Http/Kernel.

Aug
13
5 months ago
Activity icon

Awarded Best Reply on Download Laracast Videos

Hey skino, Yeah sure, you have a Download button on the episode link page, just right to the Watchlist button.

Activity icon

Replied to Download Laracast Videos

Hey skino, Yeah sure, you have a Download button on the episode link page, just right to the Watchlist button.

Jul
20
6 months ago
Activity icon

Awarded Best Reply on Dynamically Generated Nav Dropdown

One option is to use View Composers, so you only need to define the variable you want to share once.

public function compose(View $view)
{
    $view->with('categories', $this->categories);
}

Docs: https://laravel.com/docs/7.x/views#view-composers

Activity icon

Replied to Dynamically Generated Nav Dropdown

One option is to use View Composers, so you only need to define the variable you want to share once.

public function compose(View $view)
{
    $view->with('categories', $this->categories);
}

Docs: https://laravel.com/docs/7.x/views#view-composers

Jul
17
6 months ago
Activity icon

Awarded Best Reply on In Which File To Write Application Routes

Normally you would use the web.php file. If you just want api routes (to use with axios for example) you can use the api.php file. It's just a matter of organizing routes you can visit the RouteServiceProvider to see the differences between the files.

Activity icon

Replied to In Which File To Write Application Routes

Normally you would use the web.php file. If you just want api routes (to use with axios for example) you can use the api.php file. It's just a matter of organizing routes you can visit the RouteServiceProvider to see the differences between the files.