tisuchi

Sr. Software Engineer at Avana.asia

Member Since 5 Years Ago

Dhaka, Bangladesh

Experience Points
670,655
Total
Experience

0 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
1566
Lessons
Completed
Best Reply Awards
615
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 50
670,655 XP
Feb
21
1 day ago
Activity icon

Awarded Best Reply on Slug For Hindi Words

@kkhicher1

str_slug or facade version Str::slug doesn't work with non-ascii string. You can instead use this approach

Check more: https://stackoverflow.com/questions/38800581/laravel-str-slug-not-working-for-unicode-bangla/38800717

Feb
19
3 days ago
Activity icon

Replied to How To Approve All The Posts Of A Particular Employee

@noblemfd

If I understand you properly, you want something to approve multiple approve in one function. The concept is simple-

  • Get the list of the unapproved post (is_approved = false).
  • Run foreach loop with the post collections
  • Then update is_approved, false to true inside the loop
  • Save it.

You can get the idea with another approach from here- https://stackoverflow.com/questions/53212582/laravel-selecting-all-posts-where-its-first-approved-revision-is-published

Feb
17
5 days ago
Activity icon

Replied to How I Can Delete Previous Image When Update In Laravel 6?

@sumitgroup

That's why it doesn't work. You have to make sure that you get the right file before unlink.

BTW, I have noticed that, by using $bllogo variable, you are getting the new file details. You need to get the existing file.

Activity icon

Replied to How I Can Delete Previous Image When Update In Laravel 6?

@sumitgroup

Do you have any error?

You better dd() like this way to check first-

...
...
$thumbPath = public_path().'/builders_img/'.$bllogo;

// DD here to check whether you are getting the right file or not
dd($thumbPath);

if (file_exists($thumbPath)) { // unlink or remove previous image from folder
    unlink($thumbPath);
}
Activity icon

Awarded Best Reply on Nl2br In Blade Or Controller Not Working As Expected.

@drewlim7

What if you try this way?

{!! nl2br($desc) !!}
Feb
16
6 days ago
Activity icon

Replied to Nl2br In Blade Or Controller Not Working As Expected.

@drewlim7

What if you try this way?

{!! nl2br($desc) !!}
Activity icon

Awarded Best Reply on Problem In Laravel Loop

@ipibk

I can see Several errors there:

  • route name should be a string (in quotes),
  • route parameter should be an associative array,
  • in provided example, closing parenthesis missed

(Assuming that parameter in Route is id), try with

{{ route('siswa.update', ['id' => $siswa->id]) }}

https://laravel.com/docs/master/routing#named-routes

Activity icon

Awarded Best Reply on How To Download Laravel Project From Live Server

@ivanleoncz69

Generally speaking, that approach should be fine as long as you treat your local copy as a fresh Laravel installation. In other words, you'll probably need to update your local .env file with your database connections and app properties (or by adjusting appropriate files in the config directory) and then open a command prompt and navigate to your local copy and run npm install, composer install, php artisan migrate and npm run dev.

This will install any missing dependencies that your app requires, setup your local database and recompile local assets like css and javascript. Once that is successful, you should be able to run php artisan serve and browser to http://127.0.0.1:8000/ to confirm everything is up and running.

Hope it makes sense.

Activity icon

Replied to Laravel Package Licence ?

@bed

You can check this article where they talked about the uses of NOVA in open-source applications. Hope you will get your answer there.

https://medium.com/@WaveHack/using-laravel-nova-with-your-open-source-application-42855e7cd992

Activity icon

Replied to How To Download Laravel Project From Live Server

@ivanleoncz69

Generally speaking, that approach should be fine as long as you treat your local copy as a fresh Laravel installation. In other words, you'll probably need to update your local .env file with your database connections and app properties (or by adjusting appropriate files in the config directory) and then open a command prompt and navigate to your local copy and run npm install, composer install, php artisan migrate and npm run dev.

This will install any missing dependencies that your app requires, setup your local database and recompile local assets like css and javascript. Once that is successful, you should be able to run php artisan serve and browser to http://127.0.0.1:8000/ to confirm everything is up and running.

Hope it makes sense.

Activity icon

Replied to Problem In Laravel Loop

@ipibk

I can see Several errors there:

  • route name should be a string (in quotes),
  • route parameter should be an associative array,
  • in provided example, closing parenthesis missed

(Assuming that parameter in Route is id), try with

{{ route('siswa.update', ['id' => $siswa->id]) }}

https://laravel.com/docs/master/routing#named-routes

Feb
12
1 week ago
Activity icon

Replied to SQLSTATE[23000]: Integrity Constraint Violation: 1052 Column 'name' In Where Clause Is Ambiguous

@jinsonjose

Use ` before and after your code to make your code readable.

Activity icon

Awarded Best Reply on How Do You Apply SOLID Principle In Laravel?

@jonjie

It's a kind of tricky question that how do you apply SOLID in your code.

However, have you checked JeffreyWay's this video series

Besides, I can share some other resource, that you can take a look.

Activity icon

Awarded Best Reply on Laravel Route Getting Error

@saly3301

Specifying the format of your slug using Regex might help the Router when it resolves your url.

routes/web.php

Route::get('{slug}-lawyer-in-nepal', [
    'as' => 'practise-area.detail',
    'uses' => '[email protected]'
])->where('slug', '[\w-]{1,}[^-]');

You can take a look at the Laravel Routing - Regular Expression Constraints documentation for more information.

Activity icon

Replied to Hi, Could You Recommend Me Packages For Education Systems?

@kackbip

What do you mean by the education system? Can you make it clear what types of the package you are looking for?

Activity icon

Replied to Laravel Route Getting Error

@saly3301

Specifying the format of your slug using Regex might help the Router when it resolves your url.

routes/web.php

Route::get('{slug}-lawyer-in-nepal', [
    'as' => 'practise-area.detail',
    'uses' => '[email protected]'
])->where('slug', '[\w-]{1,}[^-]');

You can take a look at the Laravel Routing - Regular Expression Constraints documentation for more information.

Feb
11
1 week ago
Activity icon

Replied to How To Configure Laravel Project With Database In C-panel

@harshareddy

I am not sure exactly what you want to achieve. But if you want to know how to upload Laravel in cPanel, check this video- https://www.youtube.com/watch?v=pBTvXKGvrAA

Activity icon

Replied to Slug For Hindi Words

@kkhicher1

str_slug or facade version Str::slug doesn't work with non-ascii string. You can instead use this approach

Check more: https://stackoverflow.com/questions/38800581/laravel-str-slug-not-working-for-unicode-bangla/38800717

Feb
10
1 week ago
Activity icon

Replied to DateTime::__construct() Expects Parameter 1 To Be String, Array Given

@noblemfd

How to understand which code you are referring to?

Activity icon

Awarded Best Reply on Two Controllers Or One?

@randy_johnson

I believe the best practice to follow individual controller for each task that always follow the RESTful verbs.

I suggest you follow this video- https://www.youtube.com/watch?v=MF0jFKvS4SI&feature=emb_logo

Activity icon

Replied to How Do You Apply SOLID Principle In Laravel?

@jonjie

Thank you.

FYI, actually I didn't write these examples. I just forked that repo.

Maybe I will write some example code in Laravel with appropriate SOLID examples.

Activity icon

Replied to How To Use Where Condition Inside Foreach Loop?

@krishma

You better show your code that what you want to achieve...

Activity icon

Replied to Two Controllers Or One?

@randy_johnson

I believe the best practice to follow individual controller for each task that always follow the RESTful verbs.

I suggest you follow this video- https://www.youtube.com/watch?v=MF0jFKvS4SI&feature=emb_logo

Activity icon

Replied to Unexpected Data Found. Unexpected Data Found. Unexpected Data Found. Trailing Data

@weiman99

Have you used any date in your email template? Can you show that code?

Feb
09
1 week ago
Feb
08
2 weeks ago
Activity icon

Replied to Algolia Have Two Inputs For One Index

@smoketm

You want to search in one table with two keywords, right? In that case, can you show your table structure?

Activity icon

Replied to Inside Where

@aronaman

Show your full code instead. I believe $individualRoomReserveId is an object.

Activity icon

Awarded Best Reply on Custom E-mail Template With Auth

@pmarquinhos

So far my understanding, they don't use any blade for verification template.

Laravel uses this method of VerifyEmail notification class for [send email](https://laravel.com/api/6.x/Illuminate/Auth/Notifications/VerifyEmail.html_:

public function toMail($notifiable)
{
    if (static::$toMailCallback) {
        return call_user_func(static::$toMailCallback, $notifiable);
    }
    return (new MailMessage)
        ->subject(Lang::getFromJson('Verify Email Address'))
        ->line(Lang::getFromJson('Please click the button below to verify your email address.'))
        ->action(
            Lang::getFromJson('Verify Email Address'),
            $this->verificationUrl($notifiable)
        )
        ->line(Lang::getFromJson('If you did not create an account, no further action is required.'));
}

Method in source code

If you wanna use your own Email template, you can extend Base Notification Class.

1) Create in app/Notifications/ file VerifyEmail.php

<?php
namespace App\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\URL;
use Illuminate\Support\Facades\Lang;
use Illuminate\Auth\Notifications\VerifyEmail as VerifyEmailBase;

class VerifyEmail extends VerifyEmailBase
{
//    use Queueable;

    // change as you want
    public function toMail($notifiable)
    {
        if (static::$toMailCallback) {
            return call_user_func(static::$toMailCallback, $notifiable);
        }
        return (new MailMessage)
            ->subject(Lang::getFromJson('Verify Email Address'))
            ->line(Lang::getFromJson('Please click the button below to verify your email address.'))
            ->action(
                Lang::getFromJson('Verify Email Address'),
                $this->verificationUrl($notifiable)
            )
            ->line(Lang::getFromJson('If you did not create an account, no further action is required.'));
    }
}

2) Add to User model:

use App\Notifications\VerifyEmail;

and

/**
 * Send the email verification notification.
 *
 * @return void
 */
public function sendEmailVerificationNotification()
{
    $this->notify(new VerifyEmail); // my notification
}

Also if you need blade template: Laravel will generate all of the necessary email verification views when the make:auth command is executed. This view is placed in resources/views/auth/verify.blade.php. You are free to customize this view as needed for your application.

Ref: https://stackoverflow.com/questions/52231870/laravel-email-verification-template-location

Activity icon

Awarded Best Reply on Use Map On Laravel Single Instance

@kassir123

That's what I mean-

$data = $stats
    ->with('user')
    ->get()
    ->map(function ($value, $key) {
        return [
            'total' => $value['total'],
            'user' => $value['user']['name'],
        ];
    });
Activity icon

Replied to Use Map On Laravel Single Instance

@kassir123

That's what I mean-

$data = $stats
    ->with('user')
    ->get()
    ->map(function ($value, $key) {
        return [
            'total' => $value['total'],
            'user' => $value['user']['name'],
        ];
    });
Activity icon

Replied to Moving Files (in Bulk) In Phpstorm Not Adjusting Namespace

@rohrig

I see.

The following docs seem a closer solution that you are looking for. Take a look if it helps you-

https://www.jetbrains.com/help/phpstorm/move-refactorings.html

Activity icon

Replied to Use Map On Laravel Single Instance

@kassir123

Wouldn't this work, if you add inside your map function return $value['user']['name']?

Activity icon

Replied to Algolia Have Two Inputs For One Index

@smoketm

If I understand you correctly, you want to do multiple model searches. If so, here is docs that you can follow- https://www.algolia.com/doc/framework-integration/laravel/advanced-use-cases/multiple-models-in-one-index/?language=php

Activity icon

Replied to PHP Notice: Undefined Variable: Factory In MyWebsite/config/database/factories/UserFactory.php

@mrs_beginner

I am not sure, but there is a way to solve this issue is by adding the following line on top of the class.

/** @var \Illuminate\Database\Eloquent\Factory $factory */

So, it will be like this-

<?php

use Faker\Generator as Faker;
/** @var \Illuminate\Database\Eloquent\Factory $factory */

$factory->define(App\User::class, function (Faker $faker) {
    return [
        'name' => $faker->name,
        'email' => $faker->unique()->safeEmail,
        'password' => 'y$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret
        'remember_token' => str_random(10),
    ];
});

Ref: https://stackoverflow.com/questions/57847479/factory-undefined-variable

Activity icon

Replied to What's A Good Way To Learn Parent/child Relationships In Laravel?

@mrkarma4ya

Have you checked this tutorial? https://www.itsolutionstuff.com/post/laravel-57-comment-system-tutorial-from-scratchexample.html

They have done something from the sketch. I think it will be helpful for you.

Activity icon

Replied to Inside Where

@aronaman

What if you try this?

$orgAvailable = Organization::with('individualRooms', function ($query) use ($individualRoomReserveId) {
    $query->whereNotIn('individualRooms.id', $individualRoomReserveId);
})->first();

Activity icon

Replied to Vue Data Not Display

@tahsan

Can you show your vue code to check how do you fetch data?

Activity icon

Replied to Login Using Qrcode Like Whatsup

@vandan

Literally @sinnbeck 's solution give you a broad idea of how it works. If you want to create the flow from sketch, his thought will help you to built it.

However, I found a tutorial about it. You can take a look at it. https://www.rolandalla.com/laravel-login-qr-code/

Activity icon

Replied to In Laravel I'm Getting Error While Upload My Project On Live Like Server.

@vengateshwaran

It might be because of the different PHP version of your local and live server.

Get more details here beside @vandan solution.

Activity icon

Replied to How Do You Apply SOLID Principle In Laravel?

@jonjie

It's a kind of tricky question that how do you apply SOLID in your code.

However, have you checked JeffreyWay's this video series

Besides, I can share some other resource, that you can take a look.

Feb
07
2 weeks ago
Activity icon

Awarded Best Reply on How To Round Decemle Number In Php?

@fabriciog

Honestly, I cannot see any issue if I try to make round for the overall output.

For example, I try this where I get expected outcomes.

$output = (63/47)*100;

echo round($output);

Output: https://3v4l.org/u6dOi

Check more about round in php: https://www.php.net/manual/en/function.round.php

Activity icon

Replied to How To Round Decemle Number In Php?

@fabriciog

I believe simply try this-

round($output,1); // 00.0 will be the output. 
Activity icon

Replied to Custom E-mail Template With Auth

@pmarquinhos

So far my understanding, they don't use any blade for verification template.

Laravel uses this method of VerifyEmail notification class for [send email](https://laravel.com/api/6.x/Illuminate/Auth/Notifications/VerifyEmail.html_:

public function toMail($notifiable)
{
    if (static::$toMailCallback) {
        return call_user_func(static::$toMailCallback, $notifiable);
    }
    return (new MailMessage)
        ->subject(Lang::getFromJson('Verify Email Address'))
        ->line(Lang::getFromJson('Please click the button below to verify your email address.'))
        ->action(
            Lang::getFromJson('Verify Email Address'),
            $this->verificationUrl($notifiable)
        )
        ->line(Lang::getFromJson('If you did not create an account, no further action is required.'));
}

Method in source code

If you wanna use your own Email template, you can extend Base Notification Class.

1) Create in app/Notifications/ file VerifyEmail.php

<?php
namespace App\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\URL;
use Illuminate\Support\Facades\Lang;
use Illuminate\Auth\Notifications\VerifyEmail as VerifyEmailBase;

class VerifyEmail extends VerifyEmailBase
{
//    use Queueable;

    // change as you want
    public function toMail($notifiable)
    {
        if (static::$toMailCallback) {
            return call_user_func(static::$toMailCallback, $notifiable);
        }
        return (new MailMessage)
            ->subject(Lang::getFromJson('Verify Email Address'))
            ->line(Lang::getFromJson('Please click the button below to verify your email address.'))
            ->action(
                Lang::getFromJson('Verify Email Address'),
                $this->verificationUrl($notifiable)
            )
            ->line(Lang::getFromJson('If you did not create an account, no further action is required.'));
    }
}

2) Add to User model:

use App\Notifications\VerifyEmail;

and

/**
 * Send the email verification notification.
 *
 * @return void
 */
public function sendEmailVerificationNotification()
{
    $this->notify(new VerifyEmail); // my notification
}

Also if you need blade template: Laravel will generate all of the necessary email verification views when the make:auth command is executed. This view is placed in resources/views/auth/verify.blade.php. You are free to customize this view as needed for your application.

Ref: https://stackoverflow.com/questions/52231870/laravel-email-verification-template-location

Activity icon

Replied to Multi Auth Using Passport

@nithapple

I am not so sure what you mean?

how i can past this code Passport::tokensCan([ 'manage-order' => 'Manage order scope' 'read-only-order' => 'Read only order scope' ]);

Can you give a clear view of what you want to do there?