sauravs012

sauravs012

Software Engineer at Chandigarh

Member Since 9 Months Ago

Chandigarh

Experience Points
8,020
Total
Experience

1,980 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
39
Lessons
Completed
Best Reply Awards
4
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 2
8,020 XP
Nov
22
1 week ago
Activity icon

Replied to How To Make Perfect URL Using Paginate In Laravel?

I've tried custom code, but not works

Nov
16
1 week ago
Activity icon

Started a new Conversation How To Make Perfect URL Using Paginate In Laravel?

My Controller

$posts = Posts::where('status','publish')->orderBy('id', 'desc')->take(10)->get();
return view('front', compact('posts'));

My View

{{$posts->links}}

I want convert

http://127.0.0.1:8000/?page=3

TO

http://127.0.0.1:8000/page/3

Thanks

Sep
30
1 month ago
Activity icon

Replied to Failure While Running Vendor/bin/phpunit

I've used laravel 5.5 with php artisan make:auth

Activity icon

Replied to Failure While Running Vendor/bin/phpunit

@automica route is already created... register and login functionality is working fine but test cases returns error

Activity icon

Replied to Failure While Running Vendor/bin/phpunit

@automica what will be the correct method of it? do you have any idea?

Activity icon

Started a new Conversation Failure While Running Vendor/bin/phpunit

Time: 15.69 seconds, Memory: 52.00 MB

There was 1 failure:

  1. Tests\Unit\AddUserTest::testa_user_can_register Response status code [405] is not a redirect status code. Failed asserting that false is true.

File

<?php

namespace Tests\Unit;

use App\Models\User;
use App\Models\Role;
use Tests\TestCase;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Event;
use Illuminate\Auth\Events\Registered;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Log;

class AddUserTest extends TestCase {

    use RefreshDatabase,WithFaker;
	
	public function testa_user_can_register()
	{
		$user = [
            'first_name' => 'John',
            'last_name' => 'Doe',
            'name' => 'jhonuser',
            'email' => '[email protected]',
            'confirm_password' => 'i-love-laravel',
            'password' => 'i-love-laravel',
            'role' => 'self_enrolled_student',
            'verifiedEmail' => true,
            'dob' => '1990/08/23'
        ];

		$response = $this->post('/register', $user);

		$response
			->assertRedirect('/')
			->assertSessionHas('status', 'Zodra uw account is goedgekeurd ontvangt u een email');

		//Remove password and password_confirmation from array
		array_splice($user,4, 2);

		$this->assertDatabaseHas('users', $user);
	}
Sep
24
2 months ago
Activity icon

Replied to Seeders Not Inserting Values In DB

made a silly mistake, forgot to call the seeder

Sep
21
2 months ago
Activity icon

Replied to Seeders Not Inserting Values In DB

@saurav77 I've also tried with Model, but did not work

Activity icon

Replied to Seeders Not Inserting Values In DB

No Error php artisan db:seed ?[32mDatabase seeding completed successfully.?[39m

Activity icon

Started a new Conversation Seeders Not Inserting Values In DB

My CODE

<?php

use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;

class AlgorithmTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
		$AlgorithmData = "INSERT INTO `algorithms` (`id`, `title`) VALUES
         (1, 'test1'),
         (2, 'test2'),
         (3, 'test3')
		 ";
		DB::insert($AlgorithmData);
    }
}


Sep
20
2 months ago
Activity icon

Awarded Best Reply on PHP Unit Testing

There was an migration issue. Some migrations was in my custom package. I've moved all in Laravel migration folder. Thanks all for your valuable time

Activity icon

Replied to PHP Unit Testing

There was an migration issue. Some migrations was in my custom package. I've moved all in Laravel migration folder. Thanks all for your valuable time

Sep
08
2 months ago
Activity icon

Started a new Conversation PHP Unit Testing

Error on vendor/bin/phpunit

There was 1 failure:

1) Tests\Unit\MyTest::testUser
Failed asserting that actual size 0 matches expected size 1.

/laravel/tests/Unit/MyTest.php:37

FAILURES!
Tests: 1, Assertions: 1, Failures: 1.

My Code

<?php

namespace Tests\Unit;

use Tests\TestCase;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Event;
use Illuminate\Auth\Events\Registered;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Log;

class MyTest extends TestCase {

    use RefreshDatabase;

    public function testUser() {
        //Event::fake();
        // Creating Super Sonic Admin to Add Super Admin
        // Beacuse Middle needs Super Sonic Admin To add Super Admin


		$response = $this->post('register', [
            'first_name' => 'John',
            'last_name' => 'Doe',
            'name' => 'jhon2',
            'email' => '[email protected]',
            'confirm_password' => bcrypt($password = 'i-love-laravel'),
            'password' => bcrypt($password = 'i-love-laravel'),
            'role' => '1',
            'verifiedEmail' => true,
            'dob' => '1990/08/23'
        ]);
        // making super sonic admin
        $user = User::where('name', '=', 'jhon2')->get();
        $this->assertCount(1, $user);
        $this->assertEquals('jhon2', $user[0]->name);
        $this->assertEquals('[email protected]', $user[0]->email);
    }
}
Sep
01
2 months ago
Activity icon

Replied to Laravel Unit Testing User Register

I've used this in my RegisterTest.php file

<?php

namespace Tests\Feature;

use App\Models\User;
use Tests\TestCase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;

class RegistrationTest extends TestCase
{
public function testCreateLoginAuth() {
        $userTest = factory(User::class)->create([
            'first_name' => 'John',
            'last_name' => 'Doe',
            'name' => 'johnDoe',
            'email' => '[email protected]',
            'password' => bcrypt($password = 'i-love-laravel'),
        ]);

        $loginResponse = $this->post('/dashboard/login', [
            'email' => $userTest->email,
            'password' => $password,
        ]);
    }
}

It return below error when i run 'vendor/bin/phpunit'

  1. Tests\Feature\RegistrationTest::testCreateLoginAuth InvalidArgumentException: Unable to locate factory with name [default] [App\Models\User].
Aug
31
2 months ago
Activity icon

Started a new Conversation Laravel Unit Testing User Register

I've experienced in Laravel, but begginer in Unit testing. Can anybody helps to do user register and login testing?

Aug
21
3 months ago
Activity icon

Replied to Got Error When Run This Command: Vendor/bin/phpunit

//const activity = ['nteractivity' =>'10','1'=>''];
return [
    'roles' => array(
        'super_admin' => '2',
        'admin' => '3',
        'teacher' => '4',
        'student' => '5',
        'parent' => '6',
    )

Thanks Sinnbeck, issue fixed I've commented the const variable

Activity icon

Started a new Conversation Got Error When Run This Command: Vendor/bin/phpunit

Error

There was 1 error:

  1. Tests\Feature\ExampleTest::testBasicTest Constant activity already defined

config/Constants.php:2

Aug
06
3 months ago
Activity icon

Replied to YouTube Autoplay Feature Not Working

#CHR15K thanks for replying back, I've tried this but it's not working...

Activity icon

Started a new Conversation YouTube Autoplay Feature Not Working

I've used below code, but autoplay video is not working

<iframe width="560" height="315" src="https://www.youtube.com/embed/7i8GSNvVpfM?autoplay=1" frameborder="0" allowfullscreen></iframe>

Jun
07
5 months ago
Activity icon

Replied to Table Not Fit Inside Pdf Using DOPPDF Laibrary

fixed using

<table id="customermeta" width="100%" style="table-layout:fixed;">
Activity icon

Replied to How To Convert Html+css To Pdf

I've used DOMPDF laibray for generate PDF from html but table is not fit inside pdf using it. Table width stretches after PDF conversion...

Activity icon

Started a new Conversation Table Not Fit Inside Pdf Using DOPPDF Laibrary

I've used DOMPDF laibray for generate PDF from html but table is not fit inside pdf using it. Table width stretches after PDF conversion. Thank You!

Jun
05
5 months ago
Activity icon

Replied to How To Convert Html+css To Pdf

I have used this... Css not working perfectly there

Jun
04
5 months ago
Activity icon

Started a new Conversation How To Convert Html+css To Pdf

Hello buddies. I have used pdfdom to convert html + css to pdf but it's not converting perfectly. Help me if you have worked/fixed same type of functionality/issue. OR Is there any other laibrary which helps me to achieve this.

Thanks in Advance!!!