lavina

lavina

Member Since 4 Weeks Ago

Experience Points
290
Total
Experience

4,710 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
0
Lessons
Completed
Best Reply Awards
0
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 1
290 XP
Jan
16
1 day ago
Activity icon

Replied to Testing Login Functionality

Once removed it now actually runs without error, even though I did not make any changes. Maybe clearing all caches helped, im not sure, but i was getting thrown to a 500 status every time i tried to comment out the $this->withoutMiddleware();

Activity icon

Replied to Testing Login Functionality

@sti3bas the error i now get is: Session store not set on request

dd returns: testing

Activity icon

Started a new Conversation Testing Login Functionality

Hey guys, i am testing my log in functionality and i keep getting an error im not sure how to fix:

public function testUserCanLoginWithCorrectCredentials()
{
    $this->withoutMiddleware();
    $user = factory(User::class)->create([
        'password' => bcrypt($password = 'test'),
    ]);
    $response = $this->post($this->loginPostRoute(), [
        'email' => $user->email,
        'password' => $password,
    ]);
    $response->assertRedirect('/home');
    $this->assertAuthenticatedAs($user);
}

My user is indeed authenticated, but the error is: Response status code [500] is not a redirect status code. If i dont run withoutMiddleware i get status code 419, because i am not throwing csrf token, what am i missing?

Jan
10
1 week ago
Activity icon

Replied to Unable To Confirm Auth::user

Hello, thanks for the help, apparently the issue was with backpack, it was overwriting my default authentication

Jan
09
1 week ago
Activity icon

Started a new Conversation Unable To Confirm Auth::user

Hello, I am implementing the passport auth in an existing application.

I ran : composer require laravel/passport php artisan migrate php artisan passport:install

Added: use HasApiTokens; to User model

Updated AuthServiceProvider with: public function boot() { $this->registerPolicies();

    Passport::routes();
}

And then updated config/auth return [ ....

'guards' => [
    'web' => [
        'driver' => 'session',
        'provider' => 'users',
    ],

    'api' => [
        'driver' => 'passport',
        'provider' => 'users',
    ],
],

....

] My route is: Route::group(['middleware' => 'auth:api'], function(){ Route::get('/products', 'Api\[email protected]'); });

class CrudController extends Controller { public function allProductsList() { $id=Auth::id(); dd($id); return (Product::all()); } }

I access the link with bearer token in header And the return id is always empty, what am i missing??

Dec
18
4 weeks ago
Activity icon

Replied to Changing The Data Wrapping When Returning Json

Omg, yes, thank you!! :)

Activity icon

Replied to Changing The Data Wrapping When Returning Json

I tried that and it leads to an error:

Return value of App\Http\Controllers\CompanyController::index() must be an instance of App\Http\Resources\CompanyResourceCollection, array returned

Activity icon

Replied to Changing The Data Wrapping When Returning Json

And that wraps each of the id/name/descriptions combos together, but the whole bundle has no name

Activity icon

Replied to Changing The Data Wrapping When Returning Json

It returns: [ { "anyName": { "id": 7, "name": "Xzavier Koelpin", "description": "Nemo et vel voluptatem." } }, So the most outer wrap doesn't have a name

Activity icon

Replied to Changing The Data Wrapping When Returning Json

Wanted result would be: "anyName": [ { "id": 7, "name": "Xzavier Koelpin", "description": "Nemo et vel voluptatem." },

Activity icon

Replied to Changing The Data Wrapping When Returning Json

Found that in the documentation, but unsure how to wrap it after though

Activity icon

Started a new Conversation Changing The Data Wrapping When Returning Json

Hello guys, i am trying to return a select from my database, the resource collection class: public function toArray($request) {

    //return parent::toArray($request);
    return [
        'id' => $this -> id,
        'name' => $this -> name,
        'description' => $this ->description,
    ];
}

And then call in controller: public function index(): CompanyResourceCollection { return new CompanyResourceCollection(Company::all()); }

And i get a return of:

"data": [ { "id": 7, "name": "Xzavier Koelpin", "description": "Nemo et vel voluptatem." },

How can i change the wrapping name data to be anything i want?