manshu

at Freelance

Member Since 4 Years Ago

Vienna, VA

Experience Points
112,805
Total
Experience

2,195 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
1122
Lessons
Completed
Best Reply Awards
1
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 23
112,805 XP
Dec
01
2 weeks ago
Activity icon

Replied to Creating User For API Giving Error

No, this is perfect. I totally forgot about the raw() function. thanks @tisuchi @goldtaste @nakov @bugsysha

Activity icon

Replied to Creating User For API Giving Error

Yess !!!! raw() function worked. Thanks guys. I totally forgot about that.

Activity icon

Replied to Creating User For API Giving Error

My test

     
  /** @test */
    public function it_registers_new_user_using_api()
    {
        $this->withoutExceptionHandling();
        //Given
        $user = factory(User::class)->create()->toArray();
        //When
        $response = $this->postJson('/api/register', $user);
        //Then
        $response->assertStatus(201);
    }

My factory

$factory->define(User::class, function (Faker $faker) {
    return [
        'name' => $faker->name,
        'email' => $faker->unique()->safeEmail,
        'password' => 'yIXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
   
    ];
});

My controller


    public function store(Request $request)
    {
        $this->validate($request, [
            "name" => 'required',
            "email" => 'email|required|unique:users,email',
            "password" => 'required',
        ]);


        $user = User::create([
            'name' => $request->name,
            'email' => $request->email,
            'password' => bcrypt($request->password),
        ]);

        return response()->json([
            "status" => "Success"
        ], 201);
        
Activity icon

Replied to Creating User For API Giving Error

Nope. Simple Create User Test isn't working. Idk what im doing wrong. I keep getting 422 error for invalid data.

Activity icon

Replied to Creating User For API Giving Error

It work via postman. I am not able to pass the testcase. @tisuchi @bugsysha

Activity icon

Replied to Creating User For API Giving Error

After i removed that, i am getting following errors.

There was 1 error:

1) Tests\Feature\API\Users\UsersFeatureTest::it_registers_new_user_using_api
Illuminate\Database\QueryException: SQLSTATE[23000]: Integrity constraint violation: 19 UNIQUE constraint failed: users.email (SQL: insert into "users" ("name", "email", "password", "updated_at", "created_at") values (Dameon Reinger MD, [email protected], y$zjDqfWrC.5xFVIXWC05TAeM8kYDbxwG9g3t30en0Zi70d/w41HoTa, 2019-12-01 17:59:50, 2019-12-01 17:59:50))
Activity icon

Replied to Creating User For API Giving Error

If i remove validation, how i validate user data?

Activity icon

Replied to Creating User For API Giving Error

Here you go @tisuchi


    public function store(Request $request)
    {
        $this->validate($request, [
            "name" => 'required',
            "email" => 'email|required|unique:users,email',
            "password" => 'required',
        ]);


        $user = User::create([
            'name' => $request->name,
            'email' => $request->email,
            'password' => bcrypt($request->password),
        ]);

        return response()->json([
            "status" => "Success"
        ], 201);
        
    }

Activity icon

Replied to Creating User For API Giving Error

@tisuchi Nope doesn't work. It's redirecting from that page automatically.

Expected status code 201 but received 302.
Failed asserting that false is true.
Activity icon

Started a new Conversation Creating User For API Giving Error

Here's my User Registration Test. I am using default UserFactory.php to create user. I am getting the following error.

Illuminate\Validation\ValidationException: The given data was invalid.

<?php

namespace Tests\Feature\API\Users;

use Tests\TestCase;
use WebApp\Domain\Users\User;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;

class UsersFeatureTest extends TestCase
{
    
    use RefreshDatabase;

    /** @test */
    public function it_registers_new_user_using_api()
    {
        $this->withoutExceptionHandling();
        //Given
        $user = factory(User::class)->create()->toArray();
        //When
        $response = $this->post('/api/register', $user);
        //Then
        $response->assertStatus(201);
    }

}

Sep
05
3 months ago
Activity icon

Commented on Frontend Scaffolding Has Been Moved To Laravel UI

This is great separation of duties. Thanks for this clean way of managing things. It was much needed feature, because i started leveraging nuxtjs and reactjs for frontend.

Aug
12
4 months ago
Activity icon

Replied to Does Spark Support ACH Payments In Stripe?

Not true. I've learned a lot from here.

Aug
09
4 months ago
Activity icon

Replied to How Do I Wrap My Head Around Laravel/vue For Multipage Application

@bstory Nuxt is VueJS with Server Side Rendering. Normally, google doesn't get to scan normal VueJS code due to no serverside content scrapping. I have built a site with VUEJS and it lost all ranking, because google couldn't scrape the content to rank. So if you are looking for full stack development, try NuxtJS as frontend, and Laravel as backend. Checkout my site https://www.webgurudc.com

Aug
08
4 months ago
Activity icon

Replied to How Do I Wrap My Head Around Laravel/vue For Multipage Application

Try looking at NuxtJS for frontend and laravel as backend. Get best of both worlds.

Activity icon

Replied to Where Do Developers Hangout Usually.

So how do people collaborate here? i have a toy project, that id like someone to join, anyone interested in joining. I can share details.

Aug
07
4 months ago
Activity icon

Replied to Where Do Developers Hangout Usually.

@aurawindsurfing no upcoming events. Usually they are paid for, by specific company. Id prefer to stay away.

Activity icon

Replied to Where Do Developers Hangout Usually.

@aurawindsurfing i am around Washington DC area. I am not sure, if there are any local meetups here.

Activity icon

Replied to Where Do Developers Hangout Usually.

Lets keep this thread up. Id love to see what you guys are working on. I am at the moment, where ive been confused on what to develop. I cant find that perfect project to work on. I think ive decent knowledge. Ive developed few projects, but i am having hard time getting help, understanding what to work on. If u guys wanna chip in to give some toy project ideas, id be happy to help and develop. I think im really lost in the jargon of technologies.

Activity icon

Replied to Where Do Developers Hangout Usually.

Agreed. Jeff has humble audience.

Activity icon

Started a new Conversation Where Do Developers Hangout Usually.

Id love to help out newbies and gain knowledge from experts. Does anyone know good spots to hangout ? I.e Slack or Discord groups?

Jul
19
4 months ago
Activity icon

Commented on Series Chapters

Wait, no more Discus ... Awesome !!

Jun
15
6 months ago
Activity icon

Replied to Cities And States SQL Query

@richardev Nope. My Hype is still strong, because this is for US only. I uploaded SQL query, for quick database structure.

Activity icon

Started a new Conversation Cities And States SQL Query

It took me few hours, but finally got everything down. Here's my contribution, if any one is looking for Cities and States as SQL Dump. Just plug and play.

https://gist.github.com/manshu/1ad167e1aad0152e0311e99ad4f07a3b

Activity icon

Replied to VueJS File Upload, Not Working

Thanks guys, I was able to use base/64 image and converted it to get my solution. If anyone is interested, i can upload the code.