SarwarAhmed

SarwarAhmed

Member Since 11 Months Ago

Sylhet, BD

Experience Points
25,150
Total
Experience

4,850 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
197
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 6
25,150 XP
Oct
19
1 week ago
Activity icon

Commented on Recaptcha

If reCAPTCHA doesn't work on localhost, you can use the following test key only for testing purposes.

Site key: 6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI

Secret key: 6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe
Oct
17
1 week ago
Activity icon

Replied to Better PHPUnit Not Working On Vscode

@ilijatatalovic My folder name was "Web Project" not " Project". Yeah, you are right the problem was empty space. The directory name should be "WebProject" or a single word. Thank you.

Oct
14
2 weeks ago
Activity icon

Replied to Is It Possible To Upgrade Laravel From 5.8 To 7.X?

Activity icon

Replied to Symfony\Component\Routing\Exception\RouteNotFoundExceptionRoute [login] Not Defined

php artisan config:cache
php artisan cache:clear
php artisan route:cache
Activity icon

Replied to Is It Possible To Upgrade Laravel From 5.8 To 7.X?

Or you can use https://laravelshift.com. Everything is automated. *Not free.

Oct
13
2 weeks ago
Oct
12
2 weeks ago
Activity icon

Replied to How To Install Laravel With Vue Js

@sakthivel

I just followed those steps, and everything worked correctly. Try doing a full reset:

rm -rf node_modules
rm package-lock.json yarn.lock
npm cache clear --force
npm install

https://github.com/JeffreyWay/laravel-mix/issues/1072#issuecomment-319401164

Activity icon

Replied to Test-Driven Laravel By Adam Wathan

http://testinglaravel.com/ for beginners. I think Forum-with-TDD is easier to test-driven-aravel.

Activity icon

Replied to Bootstrap Installation With Npm

resources/sass/app.scss


// Bootstrap
@import '~bootstrap/scss/bootstrap';
Activity icon

Replied to Bootstrap Installation With Npm

@Flex What are the installation problems? You can install bootstrap framework using laravel/ui.

composer require laravel/ui
php artisan ui bootstrap
npm install
npm run dev

Now you can see compiled CSS and js file inside the public folder.

Oct
11
2 weeks ago
Activity icon

Commented on Users Must Confirm Their Email Address: #3 - Cleanup

In Laravel-8 state should be

public function unconfirmed()
{
    return $this->state(function (array $attributes) {
        return [
            'confirmed' => false,
        ];
    });
}

Uses

$user = User::factory()->unconfirmed()->create();
Activity icon

Replied to An Old Issue About SSL/TLS Protection

Did you run?

composer config -g -- disable-tls true

Just for your local machine.

Activity icon

Replied to An Old Issue About SSL/TLS Protection

Try

extension=openssl

to

extension=php_openssl.dll
Oct
08
2 weeks ago
Activity icon

Awarded Best Reply on Learning Controllers With Troubles

Import viewsController on web.php

use App\Http\Controllers\viewsController;
Activity icon

Replied to Redirecting Message To Specific Routes

@rafidahsan

return back()->with('message', 'This is a message!');

in blade.view

@if (session('message'))
    <div class="alert alert-success">
        {{ session('message') }}
    </div>
@endif
Activity icon

Replied to Learning Controllers With Troubles

Import viewsController on web.php

use App\Http\Controllers\viewsController;
Activity icon

Replied to RESTful API Many To Many

@devionti You need just three tables.

  • roles
  • permissions
  • permissions_roles
// Role Model
public function permissions(){
	return $this->belongsToMany(Permission::class);
}

// Permission Model
public function roles(){
	return $this->belongsToMany(Role::class);
}

// uses
$roles = Permission::find(1)->roles;
Oct
07
3 weeks ago
Activity icon

Replied to Laravel 8 And Vue Install Problem

Try

composer require laravel/ui
Oct
05
3 weeks ago
Activity icon

Commented on Basic View Tweaks

Use appends method. It works.

{{ $threads->appends(request()->input())->links() }}

With Laravel-8 https://github.com/SarwarAhmed/laracasts-forum/commit/9174caf2e0

Activity icon

Replied to Vue - Toggle Just One Class Among Several Classes Of Element

Use this way.

<div v-bind:class="[isActive ? 'bg-orange-100' : 'bg-blue-100']">


</div>
</button @click="toggleColor">Toggle Color</button>

Or you can use computed method

computed: {
        classes() {
		return [this.active ? 'some-class' : 'anotehr-class']
	}
}
Activity icon

Replied to Vue - Toggle Just One Class Among Several Classes Of Element

@thebigk You can simply change your toggle button color using isActive.

<button v-bind:class="[isActive ? 'bg-orange-100' : 'bg-blue-100']" @click="toggleColor">Toggle Color</button>

data() {
       return {
            isActive: true,
        }
    },
   
 methods: {
        toggleColor: function(){
            this.isActive = !this.isActive;
        },
}
Activity icon

Replied to Laravel 8: Phpunit Giving Error On Test

Put it in the DatabaseSeeder.php

use Illuminate\Database\Seeder;

then run 

composer dumpautoload
Activity icon

Replied to How To Increment For Loop In Blade

@Mattb Increment with PHP. But you can take Snapey's suggestion.

@php $n = 3 @endphp
    
@for ($i = 0; $i < 3; $i++)

    @while($i != $n+1)
    {{ $i++ }}
    @endwhile
@enfor

Output: 0 1 2 3
Oct
04
3 weeks ago
Activity icon

Replied to Fail Assert API Token Laravel

@gianmarx Your assertion returns 201 which means your data is creating. You need to change your actual code not test code.

Activity icon

Replied to Solution For My Codechef Question?

@nikunj001 Why do you use PHP for competitive programming?

Activity icon

Replied to Fail Assert API Token Laravel

Try the second assertion with fresh()

$response = $this->fresh()->withHeaders([
        'Content-Type' => 'application/json',
        'Accept' => 'application/json',
        'Authorization' => 'Bearer '.$token_fake,
    ])->get('/api');
    $response->assertStatus(401);
Activity icon

Replied to New View

@iamkevinwakhisi Yeah, you can use Vue in your application. If you are a newbie and feel uneasy to read the documentation, use laravel/ui. It provides Vue, Bootstrap or you can manually install Tailwindcss using npm.

composer require laravel/ui
php artisan ui vue --auth
Sep
30
4 weeks ago
Activity icon

Replied to Int Conversion Issue

$num = number_format("8.03" * 100, 0);

$int = (int)$num;

Activity icon

Replied to Huge Pagination Buttons

use Tailwind method on your AppServiceProvider

use Illuminate\Pagination\Paginator;

public function boot()
{
    Paginator::useTailwind();
}
Activity icon

Replied to How To Keep Value Of Selected Option After Form Submission

Use old() helper.

<option value="mahal" name="mahal" @if( old('mahal')  == request()->mahal) selected="selected" @endif>Foo</option>
Sep
29
4 weeks ago
Activity icon

Replied to TEXT Fields Vs. MySQL Strict Mode And ConvertEmptyStringsToNull

use the nullable() method For example

$table->text('foo')->nullable();
Activity icon

Replied to Display Data In Table Format From Database

@forelse($reports  as $report)
                <tr>
                    <td scope="row"><a href="/reports/show">{{$report->id}}</td>
                    <td>{{$report->title}}</td>
                    <td>{{$report->address}}</td>
                    <td>{{$report->reports_category_id}}</td>
                    <td>{{$report->name}}</td>
                    <td>{{$report->created_at}}</td>
                    <td>{{$report->updated_at}}</td>
                </tr>
@empty
	Not relevant data at this time.
@endforelse
Activity icon

Awarded Best Reply on How To Define Resource Route In Api.php In Laravel V8?

Try

Route::apiResource('tasks', TaskController::class);
Activity icon

Replied to How To Define Resource Route In Api.php In Laravel V8?

Try

Route::apiResource('tasks', TaskController::class);
Activity icon

Commented on Pagination

Install this extension on your vscode PHP Namespace Resolver and Press ctrl+alt+i

Sep
28
1 month ago
Activity icon

Replied to Laravel Ui Installation Error

you are using laravel v-7

composer require laravel/ui:^2.4
Sep
27
1 month ago
Activity icon

Awarded Best Reply on How To Use Tailwind @apply In Sass With Laravel 8?

@chancice

You can use this way in your resources/sass/app.scss

@tailwind base;

@tailwind components;

.button {
    @apply bg-blue-300 text-white no-underline rounded-lg text-sm py-2 px-5
}

@tailwind utilities;

webpack.mix.js

const mix = require('laravel-mix');
const tailwindcss = require('tailwindcss')

mix.js('resources/js/app.js', 'public/js')
    .sass('resources/sass/app.scss', 'public/css')
    .options({
        processCssUrls: false,
        postCss: [ tailwindcss('./tailwind.config.js') ],
    })
Sep
26
1 month ago
Activity icon

Replied to How To Use Tailwind @apply In Sass With Laravel 8?

@chancice

You can use this way in your resources/sass/app.scss

@tailwind base;

@tailwind components;

.button {
    @apply bg-blue-300 text-white no-underline rounded-lg text-sm py-2 px-5
}

@tailwind utilities;

webpack.mix.js

const mix = require('laravel-mix');
const tailwindcss = require('tailwindcss')

mix.js('resources/js/app.js', 'public/js')
    .sass('resources/sass/app.scss', 'public/css')
    .options({
        processCssUrls: false,
        postCss: [ tailwindcss('./tailwind.config.js') ],
    })
Sep
23
1 month ago
Activity icon

Replied to Factory Created_at

'created_at' => \Carbon\Carbon::yesterday()
'created_at' => \Carbon\Carbon::now()
Sep
20
1 month ago
Activity icon

Commented on Authorized Users Can Delete Replies

Hi, @rockett In Episode-7 we created some testing helpers right?. $this->singIn() call to a method on TestCase class.

<?php

namespace Tests;

use Illuminate\Foundation\Testing\TestCase as BaseTestCase;

abstract class TestCase extends BaseTestCase
{
    use CreatesApplication;

    protected function signIn($user = null)
    {
        $user = $user ?: create('App\Models\User');

        $this->actingAs($user);

        return $this;
    }
}

Code Episode 7 Episode 31 with Laravel-8

Sep
17
1 month ago
Activity icon

Replied to Update Version From 7x A 8.3

Models folder didn't create automatically. You have to create it manually.

Sep
15
1 month ago
Activity icon

Replied to Don't Create FK With User_id With Factory

return [
	'user_id' => User::factory()->create(), // Fk User
	...
	]