sauravs012

sauravs012

Software Engineer at Chandigarh

Member Since 7 Months Ago

Chandigarh

Experience Points
7,870
Total
Experience

2,130 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
7,870 XP
Sep
21
6 hours 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
1 day 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
1 week 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 weeks 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
3 weeks 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
1 month 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
1 month 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
3 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
3 months ago
Activity icon

Replied to How To Convert Html+css To Pdf

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

Jun
04
3 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!!!

May
22
3 months ago
Activity icon

Replied to How To Generate Excel And Attach With Email?

I also need help with this issue..

May
20
4 months ago
Activity icon

Started a new Conversation Make Laravel Schedule Command Last Day Of Month At Time

I want to send list of users to admin on last day of month which are registered on current month. I've not any experience in laravel scheduling

May
07
4 months ago
Activity icon

Replied to Files Automatically Deletes

got the issue.. When I pull on server files are deleting... what i can do?

May
03
4 months ago
Activity icon

Replied to Files Automatically Deletes

Yes in the fresh Laravel

May
02
4 months ago
Activity icon

Started a new Conversation Files Automatically Deletes

In my App pictures are saved in storage/app/public, but somehow they are deleted automatically. Please let me know if you can help me to fix this. Thanks

Apr
19
5 months ago
Activity icon

Replied to Link On Another Page To Last Pagination URL [ SOLVED ]

you can use jQuery

$(".pagination li:last-child a").attr('href','CUSTOM URL HERE');
Apr
16
5 months ago
Activity icon

Replied to Take Backup Of Whole Website With Database

I want to take a backup in my local. For this I've run the command

php artisan backup:run

It returns

[33mStarting backup...[39m

[33mIn DbDumper.php line 148:[39m
[37;41m
       [39;49m
[37;41m  Too few arguments to function Spatie\DbDumper\DbDumper::setDumpBinaryP
ath()  [39;49m
[37;41m  , 0 passed in C:\xampp\htdocs\creafted\pluglist\vendor\spatie\laravel-
backu  [39;49m
[37;41m  p\src\Tasks\Backup\DbDumperFactory.php on line 88 and exactly 1 expect
ed     [39;49m
[37;41m
       [39;49m

Activity icon

Started a new Conversation Take Backup Of Whole Website With Database

Hi All, How I can take backup of my laravel files daily using cron job with database. Thanks in advance.