tisuchi

Sr. Software Engineer at Avana

Member Since 4 Years Ago

Dhaka, Bangladesh

Experience Points
523,285
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
1550
Lessons
Completed
Best Reply Awards
378
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
523,285 XP
Dec
16
4 hours ago
Activity icon

Replied to Warning: Mysqli_num_rows() In Php

@minhankyaw

Where you want to apply this?

Activity icon

Awarded Best Reply on How To Use Search In Laravel?

You can use multiple where clause.

$data['ads'] = PostAd::where('category_id',$category_id)
               ->where('adtitle','LIKE','%'.$search.'%')
               ->get();

Or

$data['ads'] = PostAd::where([
                   ['category_id',$category_id],
                   ['adtitle','LIKE','%'.$search.'%']
               ])
               ->get();
Activity icon

Replied to How To Make Laravel Password Stronger?

@su3158y

You can add wathever validation rules you want in the Laravel RegisterController. Just update the rule for password with the extra limitations:

https://github.com/laravel/laravel/blob/master/app/Http/Controllers/Auth/RegisterController.php#L49

return Validator::make($data, [
    'name' => ['required', 'string', 'max:255'],
    'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
    'password' => ['required', 'string', 'min:8', 'confirmed'], // <-- This one
]);
Activity icon

Replied to How To Use Search In Laravel?

You can use multiple where clause.

$data['ads'] = PostAd::where('category_id',$category_id)
               ->where('adtitle','LIKE','%'.$search.'%')
               ->get();

Or

$data['ads'] = PostAd::where([
                   ['category_id',$category_id],
                   ['adtitle','LIKE','%'.$search.'%']
               ])
               ->get();
Dec
15
1 day ago
Activity icon

Replied to Mailgun Missing Domain

@jerauf

The place where you put the domain name. It most probably in the mailgun settings.

Activity icon

Awarded Best Reply on Laravel Email Is Not Sending

@abuhenam

Instead of using Mail::failures() you can use !empty(Mail::failures()) or count(Mail::failures()) > 0.

Mail::failures() Function returns an array of Email addresses which are failed.

Ref: https://laravel.com/api/6.x/Illuminate/Contracts/Mail/Mailer.html#method_failures

Activity icon

Replied to How To Update Multi Select

OMG. Nono. You are right @bobbybouwmann I read something wrong. I read upload instead of update. Thank you.

Activity icon

Awarded Best Reply on How To Use Trim Function In Laravel?

@sumitkumarm

I found a related answer. It might be helpful for you.

You can try this-

$data = DB::table('table_name')
->select(
  DB::raw("TRIM(CONCAT(field1,' ',field2,' ',field3)) AS Name")
)->get();

Ref: https://stackoverflow.com/questions/55319163/how-to-perform-trim-and-concat-in-laravel-query-builder

Activity icon

Replied to Laravel Email Is Not Sending

@abuhenam

Instead of using Mail::failures() you can use !empty(Mail::failures()) or count(Mail::failures()) > 0.

Mail::failures() Function returns an array of Email addresses which are failed.

Ref: https://laravel.com/api/6.x/Illuminate/Contracts/Mail/Mailer.html#method_failures

Activity icon

Replied to How To Update Multi Select

@bobbybouwmann Correct me if I am wrong. Doesn't it (enctype="multipart/form-data") required for file upload control over html form?

Activity icon

Replied to How To Update Multi Select

@ramazan

You can simply add multiple in your select element.

Like this-

<select multiple>

BTW, you have to make sure, your form has enctype property.

enctype="multipart/form-data"
Activity icon

Replied to How To Use Trim Function In Laravel?

@sumitkumarm

I found a related answer. It might be helpful for you.

You can try this-

$data = DB::table('table_name')
->select(
  DB::raw("TRIM(CONCAT(field1,' ',field2,' ',field3)) AS Name")
)->get();

Ref: https://stackoverflow.com/questions/55319163/how-to-perform-trim-and-concat-in-laravel-query-builder

Activity icon

Replied to How To Update Multi Select

@ramazan

What is your error here?

Activity icon

Awarded Best Reply on Laravel Get Month Name By Query

@charlesk

Try this-

Visitor::whereYear('created_at', Carbon::now()->year)
->select(DB::raw("MONTH(created_at) month"),DB::raw("count('month') as vistors_count"))
       ->groupby('month')
       ->get();
Activity icon

Replied to Laravel Get Month Name By Query

@charlesk

Try this-

Visitor::whereYear('created_at', Carbon::now()->year)
->select(DB::raw("MONTH(created_at) month"),DB::raw("count('month') as vistors_count"))
       ->groupby('month')
       ->get();
Activity icon

Replied to Use Laravel API By Another (external) Laravel Project

@ahoi

Mainly most of the api endpoints are protected. Since you have a access token, you should easily able to access any protected api. Now the only question is scope. Does the scope allows you to access or not.

Activity icon

Replied to Laravel Get Month Name By Query

@charlesk

So, what you are expecting now? Do you expect the whole month list?

Activity icon

Replied to Laravel Get Month Name By Query

@charlesk

Do you get any error? or you have output?

Activity icon

Awarded Best Reply on Why Route Is Not Working In Laravel 6?

@monamuhr77

Here is the problem.

When you want to add an extra route to your resource route, add it above the resource route.

Try this-

 Route::get('admin/{id}', '[email protected]')->name('admin.deactivate');
 Route::resource('admin', 'AdminController');
Activity icon

Replied to Why Route Is Not Working In Laravel 6?

@monamuhr77

Here is the problem.

When you want to add an extra route to your resource route, add it above the resource route.

Try this-

 Route::get('admin/{id}', '[email protected]')->name('admin.deactivate');
 Route::resource('admin', 'AdminController');
Activity icon

Awarded Best Reply on Trying To Get Property Of Non-object

@diliphiraparak

I believe your problem is somewhere in $target = $request->target line.

Try this-

$target = $request->target;
$targetJson = json_decode($target);
$fruits = $targetJson['fruits'];
Activity icon

Replied to Trying To Get Property Of Non-object

@diliphiraparak

I believe your problem is somewhere in $target = $request->target line.

Try this-

$target = $request->target;
$targetJson = json_decode($target);
$fruits = $targetJson['fruits'];
Activity icon

Replied to Why Route Is Not Working In Laravel 6?

@monamuhr77

First check whether you have the right route or not, that you are trying to access. May be this command will help you-

php artisan route:list
Activity icon

Awarded Best Reply on Laravel App/login Not Found

@sajjadali97

In the server, it's normally cased sensitive.

So, it will be

use App\Login;

instead of

use app\Login;
Activity icon

Replied to Understanding Laravel Notification System

@ssuvin94

Have you checked the official documentation? Isn't that easy enough? https://laravel.com/docs/6.x/notifications

Activity icon

Replied to Laravel App/login Not Found

@sajjadali97

In the server, it's normally cased sensitive.

So, it will be

use App\Login;

instead of

use app\Login;
Activity icon

Replied to Pass Id_table To A Modal View

@felloz Unfortunately you cannot delete posts in Laracasts.

Dec
14
2 days ago
Activity icon

Replied to How To Count Number Of Fields Of Table

@irankhosravi

It's a plan id that you are using in where() condition.

Activity icon

Replied to How To Count Number Of Fields Of Table

@irankhosravi

Try this-

$orders = Order::where('plan_id', $planId)->get();

$orders->count()
Activity icon

Replied to Laravel Theme Development Option By 3rd Party

@theonlinethomas Please mark as solved if you feel that @sinnbeck provides you the right info.

Activity icon

Replied to How To Sent Mail In Laravel?

@nafeeur10

You are planning to send emails to their client on behalf of them from their email address?

Activity icon

Awarded Best Reply on How To Put Having Query With Sum In Laravel Eloquent?

@theonlinethomas

Try this-

 $postQuery = Foundation::query()
            ->join('foundation_sector', 'foundation_sector.foundation_id', '=', 'foundations.id')
            ->join('sectors', 'sectors.id', '=', 'foundation_sector.sector_id')
            ->groupBy('foundations.id');

        foreach ($sectors as $sector) {
            $postQuery = $postQuery->havingRaw('SUM(sectors.title = ?)', [$sector]);
        }
Activity icon

Replied to How To Put Having Query With Sum In Laravel Eloquent?

@theonlinethomas

Try this-

 $postQuery = Foundation::query()
            ->join('foundation_sector', 'foundation_sector.foundation_id', '=', 'foundations.id')
            ->join('sectors', 'sectors.id', '=', 'foundation_sector.sector_id')
            ->groupBy('foundations.id');

        foreach ($sectors as $sector) {
            $postQuery = $postQuery->havingRaw('SUM(sectors.title = ?)', [$sector]);
        }
Activity icon

Replied to Trying To Get Property 'email' Of Non-object

@shirshadebnath

If it doesn't work after running the command that @martal suggested, then try after restarting (if you use php artisan serve, then just stop and run again) your PHP Server.

It seems that the env variable is not reflecting.

Activity icon

Awarded Best Reply on Laravel How To Pass Data In Update Route?

You don't need to put the id on an array. Just use the id as the second parameter of route() function.

Try -

<form action="{{route('sub-admin.update',1)}}" id="edit-sub-admin" method="POST" enctype="multipart/form-data">
</form>
Activity icon

Replied to Laravel How To Pass Data In Update Route?

You don't need to put the id on an array. Just use the id as the second parameter of route() function.

Try -

<form action="{{route('sub-admin.update',1)}}" id="edit-sub-admin" method="POST" enctype="multipart/form-data">
</form>
Activity icon

Awarded Best Reply on How To Use Where In Eloquent Properly?

@jannatkhan

You can directly use where before group by or after.

$destination = Trip::select('destination')
      ->selectRaw('COUNT(*) AS count')
      ->where('client_id', $userClientId)
      ->groupBy('destination')
      ->orderByDesc('count')
      ->limit(5)
      ->get();
Activity icon

Replied to What Type Of Hosting

@mbo You can easily use cpanel for laravel that bring some other services for you out of the box. https://www.youtube.com/watch?time_continue=38&v=pBTvXKGvrAA&feature=emb_logo

Ofcourse you will get more tutorials how to do that.

Activity icon

Replied to How To Use Where In Eloquent Properly?

@jannatkhan

You can directly use where before group by or after.

$destination = Trip::select('destination')
      ->selectRaw('COUNT(*) AS count')
      ->where('client_id', $userClientId)
      ->groupBy('destination')
      ->orderByDesc('count')
      ->limit(5)
      ->get();
Activity icon

Awarded Best Reply on Why Getting This Error?

@emianakib

You can just generate the proper datetime format (without minutes) and use DATE_TRUNC() to compare it:

$dateNowToMinute = Carbon::now()->format('Y-m-d H:i');
$recordings = Recording::with('therapy')
    ->where(DB::raw("DATE_TRUNC('minute', executes_at)"), '=', $dateNowToMinute)
    ->get();
Activity icon

Replied to Why Getting This Error?

@emianakib

You can just generate the proper datetime format (without minutes) and use DATE_TRUNC() to compare it:

$dateNowToMinute = Carbon::now()->format('Y-m-d H:i');
$recordings = Recording::with('therapy')
    ->where(DB::raw("DATE_TRUNC('minute', executes_at)"), '=', $dateNowToMinute)
    ->get();
Activity icon

Awarded Best Reply on Laravel Excel Datetime Not Working

@mizzaty

Try to add the start_date to the $dates attribute in your Project model

class Project extends Model
{
    protected $dates = ['created_at', 'updated_at', 'expiry_date', 'start_date'];
}

If the attribute is in $dates, the field will be returned as an instance of Carbon and not a simple string, then Maatwebsites Excel will use it to get the right format.

Activity icon

Replied to Laravel Excel Datetime Not Working

@mizzaty

Try to add the start_date to the $dates attribute in your Project model

class Project extends Model
{
    protected $dates = ['created_at', 'updated_at', 'expiry_date', 'start_date'];
}

If the attribute is in $dates, the field will be returned as an instance of Carbon and not a simple string, then Maatwebsites Excel will use it to get the right format.