tisuchi

Sr. Software Engineer at Avana

Member Since 4 Years Ago

Dhaka, Bangladesh

Experience Points
428,505
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
1570
Lessons
Completed
Best Reply Awards
288
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
428,505 XP
Nov
17
7 hours ago
Activity icon

Replied to What Theme Jeffrey Way Ise On Laravel 6 From Scratch Course?

@luisalmeida it seems the Material Theme. I guess he has some extra plugin for file icons.

Activity icon

Replied to What Theme Jeffrey Way Ise On Laravel 6 From Scratch Course?

It seems the Material Theme. Event he was using the material theme for his previous tuts.

Check this out- https://github.com/equinusocio/material-theme

Nov
05
1 week ago
Activity icon

Replied to Search With Location Radius

Actually this is the formula that Google provides us.

Nov
01
2 weeks ago
Activity icon

Replied to How To Share The Same Data Between Methods In The Controller?

@4unkur

Have you thought about constructor? You may just call the category model inside the constructor of your class and assign it into a variable.

A sample code is like this-

protected $categories;

public function __construct(){
    $this->categories = Category::with('subCategories')->get(); 
}

public function create()
{
    return view('product.create')
        ->with('categories', $this->categories);
}


public function edit(Product $product)
{
    return view('product.edit')
        ->with([
            'product' => $product,
            'categories' => $this->categories
        ]);
}
Activity icon

Replied to Check If Leave Application Exists Within Dates

I don't think so the whereBetween is the right way to solve your issue since your db structure is bit different.

In that case, you may try this-

$leave_exists = Leave::where('employee_id',$request->employee_id)
    ->where('from_date', '>=', $request->from_date)
    ->where('to_date', '<=', $request->to_date)
    ->get();
Oct
30
2 weeks ago
Activity icon

Awarded Best Reply on How To Get Domain Name?

Have you tried parse_url()? It should work.

For example-

$url = 'http://laravel-school.com/posts/understanding-autoload-and-namespace-in-php-57';
$parse = parse_url($url);
echo $parse['host'];  // prints 'laravel-school.com'

Check here: http://laravel-school.com/snippets/how-to-get-a-domian-name-from-the-url

Activity icon

Replied to How To Get Domain Name?

Have you tried parse_url()? It should work.

For example-

$url = 'http://laravel-school.com/posts/understanding-autoload-and-namespace-in-php-57';
$parse = parse_url($url);
echo $parse['host'];  // prints 'laravel-school.com'

Check here: http://laravel-school.com/snippets/how-to-get-a-domian-name-from-the-url

Oct
17
1 month ago
Activity icon

Replied to Array To String Conversion Laravel 5.8

Show us, what's it returning...

$setting->where('namesetting' , $key)->first();
Activity icon

Replied to Change Status After Insterting

You better use ``` before and after your code block.

Your code is not readable.

Activity icon

Replied to Array To String Conversion Laravel 5.8

I guess, the problem is in this line-

$siteSettingUpdate = $setting->where('namesetting' , $key)->get()[0]; 

You can do this way-

$siteSettingUpdate = $setting->where('namesetting' , $key)->first();

Hope it will be working.

Activity icon

Replied to Calculation Of Progress Of That Particular Week

Here could be the process-

  • Get all the completed tasks this week. This could be found based on the updated_at column or if you have a separate column for tracking the completion time.
  • Then do calculation completed / total * 100.
Oct
12
1 month ago
Activity icon

Replied to Syntax Error On Group By

@mattb

Once you turn strict to false, it shouldn't break your code. It should work fine. Try first.

BTW, have you checked this? https://stackoverflow.com/questions/40917189/laravel-syntax-error-or-access-violation-1055-error

Activity icon

Replied to Chunk

Basically it will grab all the records from the DB but load 100 records in the memory. It's kind of limit and offset in pagination.

You better read the chunk part here. http://laravel-school.com/posts/laravel-pagination-vs-chunk-51

Activity icon

Replied to How To Create Profile URL Like Laracasts?

I think adding @ simply in front of your slug will solve your issue.

Route::get('@{slug}', '[email protected]');

Try.

Oct
10
1 month ago
Activity icon

Replied to Attendance Value Problem In Laravel

Then maybe you can use any local calendar to get the local holidays. Then you can apply your logic on that based on working days.

I am not sure, you can try google calendar also if it supports.

Oct
09
1 month ago
Activity icon

Replied to Attendance Value Problem In Laravel

So far I can understand that, the major changes between two projects are the value for the present, half-day and absent. So, in that case, why not you just count how many present and half day to get the total present in a month. Isn't that working for you?

Suggestion: To be honest, it is advisable to store a numeric number for your present, half day and absent value in db. It will be easier for handling.

Oct
08
1 month ago
Activity icon

Replied to My Question

Personally I recommend you not to store in another table. If you store in another table, you need to update relative tables also once the data has changed in the main table.

So, it is advisable to retrieve data based on your demand.

Sep
29
1 month ago
Activity icon

Replied to Laravel | Routing Overlapping Problem

If you change your route order a bit, I guess it will work for you.

Route::get('contact/', '[email protected]');
Route::get('/{slug}', '[email protected]');

Order slug in the bottom.

Activity icon

Replied to How To Make A Single Form For Edit And Update And Also For Adding

If you have the same properties for your forms for creating and updating, then you just need to change the form action only.

In that case, you can try this way-

<form action="@if(Route::currentRouteName() == 'something.create') 'something.create' @else 'something.update' @end" method="POST" />

Here, something.create or something.update is the name of your create and update route accordingly.

Sep
25
1 month ago
Activity icon

Replied to Multiple Table Queries

Nope. The answer is bit different than him.

Anyways, thank you.

Activity icon

Replied to Multiple Table Queries

First of all, make sure your $id is returning the data.

Then try this. It should work.

Products::with('company', function($q){
    $q->where('visible', 0);
})->where('category_id', $id)
->groupBy('company_id')->get()
Activity icon

Replied to How To Get Only The Minimum Value ?

Have you tried this way?

return taskStatus::orderBy('order', 'asc')
    ->take(1)
    ->whereIn('id', [3,5,6,7,1,2])->get();
Activity icon

Replied to Multiple Table Queries

You can achieve this by using a relationship.

Products::with('visible', function($q){
    $q->where('visible', 0);
})->where('category_id', $id->id)
->groupBy('company_id')->get()

Now, you have to make sure that you have a relationship between products and companies tables. It should be an a company has many products.

Ref: https://laravel.com/docs/6.x/eloquent-relationships#one-to-many

Activity icon

Replied to How To Pluralise Word In Laravel?

Have you tried with str_plural()?

In your view, you can try this way.

{{ $users }} {{ str_plural('user', $users) }}

Ref: https://laravel.com/docs/6.x/helpers#method-str-plural

Sep
23
1 month ago
Activity icon

Replied to Find Collection By Id

Maybe you can use whereHas().

$customer_ledger=Sales::whereHas('customer')
        ->with('customer')
        -> select('invoice_no','customer_id','created_at',DB::raw('sum(amount) as totalM'))
        ->where('customer_id', $id)
        ->groupby('invoice_no','customer_id','created_at')
        ->get();
Activity icon

Replied to Laravel Eloquent JOINS & Relationships Issue

That suppose to be one to many, as of I am thinking right now. Again it depends on your plan, to be honest.

Activity icon

Replied to Laravel Eloquent JOINS & Relationships Issue

@engrlaravel

Have you tried this?

$plans = Plan::with('positions')
        ->doesnthave('vacancy')
        ->where('created_by', 7)
        ->get();

You have to make sure that, you have the proper relationship with plan, positions and vacancy tables.

Sep
16
2 months ago
Activity icon

Replied to Facebook\WebDriver\Exception\SessionNotCreatedException: Session Not Created

@hasibweb

Actually I was facing this issue also. Mainly I found this issue for not having an updated version of google chrome. I believe, if you update your chrome version, you won't see this anymore.

Still, if you are facing this issue, check out this discussion. https://github.com/laravel/dusk/issues/641

Aug
29
2 months ago
Activity icon

Replied to API For Mobile Application

@pnandu1990

As per I know, there is no dedicated series about API for the mobile client in Laravel.

However, you can check it out this- https://laracasts.com/series/laravel-vue-and-spas

Aug
28
2 months ago
Activity icon

Replied to Anyway To Pass Parameter Into Eloquent Function?

Yeah, correct. I didn't know that. Thank you, guys.

@kankai the best approach for your issue is @martinbean solution.

Activity icon

Replied to Anyway To Pass Parameter Into Eloquent Function?

He is trying to apply to the relationship. Can we do like that way also?

Wouldn't be applied to the $game_id?

$game_id->detail()->whereDate('created_at', '=' $date)->get();
Aug
27
2 months ago
Activity icon

Replied to Laravel Cart Not Picking Up Food Price

@matildah

In general, I have a suggestion about your code.

It is highly recommended to avoid put logical code in your view. It doesn't look good at all.

<?php $total += (int)$details['price'] *(int)$details['quantity'] ?>
Activity icon

Replied to Pivot Tables Issue

@conixs

I believe, this discussion is closed to your issue. Maybe it will helpful for you. https://stackoverflow.com/questions/23336145/laravel-how-to-use-multiple-pivot-table-relationships

Activity icon

Replied to How To Check If Variable Is Empty/null/NULL/not Set/0

@engrlaravel

There are probably two options I can think of right now.

  1. You need to write a regular expression then check whether it return value or not. In that case, you can easily handle without using many built-in functions.

  2. By somehow if you need to use built-in functions, I believe you have to use at least two functions to cover all . of your criteria.

Now choose is yours, which one you will pick up.

Aug
26
2 months ago
Activity icon

Replied to User : FindOrFail Return First_name And Last_name In Attributes But $user->first_name Is Empty

@mostafalaravel

It's because of the following code in your model-

public static function boot()
    {
        static::creating(function ($user) {
            //$fullName = explode('.',strstr($user->email, '@', true));
            $user->first_name = "";
            $user->last_name = "";
        });

        parent::boot();
    }

If you take it off, it should work fine.

Activity icon

Replied to How To Check If Variable Is Empty/null/NULL/not Set/0

@engrlaravel

If this data comes from the user form, you can define everything in form validation part. It will be easier for you to handle.

Activity icon

Replied to How To Get Client_id, Client_secret In Google +?

@mstdmstd I believe you will get a lot of tutorials online.

Have you checked this? https://demonuts.com/laravel-google-login/

Activity icon

Replied to Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_PARSE) Syntax Error, Unexpected '$subcategory' (T_VARIABLE)

@kanchan186

I think the line of 83 should be like this-

$subcategory= \DB::table('subcategories')
          ->join('products','subcategories.p_id','=','products.p_id')
          ->join('categories','subcategories.c_id','=','categories.c_id')
          ->get();

You need to use DB to join tables instead of eloquent.

I just reindent the whole code because it's not readable. It should be like this-

<?php
namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\product;
use App\category;
use App\subcategory;
use File;

class SubcategoryController extends CategoryController {
    
    public function addstg() {
        $product = product::get();
        $category = category::get();
        $subcategory = subcategory::get();
        return view('addstg', compact('product', 'category', 'subcategory'));
    }
    
    public function store2(Request $request) {
        if ($request->hasFile('s_image')) {
            $file = $request->file('s_image');
            $destinationPath = public_path() . "/sub_img";
            $filename = $file->getClientOriginalName();

            if (!File::exists($destinationPath)) {
                File::makeDirectory($destinationPath, $mode = 0777, true);
                $file->move($destinationPath, $filename);
            } else {
                $file->move($destinationPath, $filename);
            }
        }

        subcategory::create([
          'p_id' => request('p_id'), 
          'c_id' => request('c_id'), 
          's_name' => request('s_name'), 
          's_image' => $filename
        ]);

        $product = product::get();
        $category = category::get();
        $subcategory = subcategory::get();

        return redirect('viewsub');
    }

    public function show2() {
        $product = product::get();
        $category = category::get();
        $subcategory = subcategory::get();

        $subcategory= \DB::table('subcategories')
          ->join('products','subcategories.p_id','=','products.p_id')
          ->join('categories','subcategories.c_id','=','categories.c_id')
          ->get();

        return view('subview', compact('category', 'product', 'subcategory'));
        return redirect('subview');
    }
}

Activity icon

Replied to Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_PARSE) Syntax Error, Unexpected '$subcategory' (T_VARIABLE)

@kanchan186

There should be a line number in this test Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_PARSE) syntax error, unexpected '$subcategory' (T_VARIABLE).

Show the line number.

Activity icon

Replied to How To Get Client_id, Client_secret In Google +?

The Google Plus service is shut down only. The rest of the services from Google is working perfectly. For example Gmail, you can use it smoothly.

Activity icon

Replied to Laravel Add Attachment File From Public Folder To Email

Have you tried with attachFromStorage() since you are trying to attach the file from the public path?

Check the Attaching Files from Disk https://laravel.com/docs/5.8/mail#attachments

Activity icon

Replied to Anyway To Pass Parameter Into Eloquent Function?

Instead of using relationship in the detail() method, may be you can use Local Scope to fix this issue. I believe you can easily pass parameter in scope.

Ref: https://laravel.com/docs/5.8/eloquent#local-scopes

Activity icon

Replied to How To Get Client_id, Client_secret In Google +?

Just to inform you that-

Legacy Google+ APIs have been shut down as of March 7, 2019. Changes to the shutdown plan have been made recently which may mitigate its effect on some developers. Learn more. Google+ integrations for web and mobile apps have also stopped functioning as of March 7, 2019. Learn more.

Reference: https://developers.google.com/+/web/api/rest/

Jul
24
3 months ago
Activity icon

Replied to How To Upgrade PHP In Mac?

If I understand you properly, it's called installation PHP globally. Of course, there are many tutorials around, however, I wrote tips on how to upgrade PHP version on Mac. Check this post. http://laravel-school.com/posts/macbook-update-php-version-globally-35

Jul
23
3 months ago
Activity icon

Replied to Eloquent Relationship Collection With Name 'links' Returning Null

If I am not mistaken, it conflicts with links() from pagination. I am not sure whether you can use it or not. But since it works changing the name a bit, better use changed name.

https://laravel.com/api/5.8/Illuminate/Pagination/Paginator.html#method_links

Jul
16
4 months ago
Activity icon

Replied to How To Use 1 ,2 3 In Slug Laravel ?

In your post, you can create a new method like this way-

public function setSlugAttribute($value)
    {
        if (static::whereSlug($slug = str_slug($value))->exists()) {
            $slug = "{$slug}-{$this->id}";
        }
        $this->attributes['slug'] = $slug;
    }
Activity icon

Replied to How To Get A Specific Categories With Its Sub Categories Item?

Have you tried by fetching relationship data?

Category::with('subcategories')->whereNull('is_parrent')->get();

It should return you sub-categories for each category.

Jul
03
4 months ago
Activity icon

Replied to How To Add Extra Column In Existing Table?

You need to run php artisan make:migration add_profile_photo_to_users in your .terminal. It will create a migration file that you need to update.

Read this: http://laravel-school.com/posts/how-to-add-new-columns-to-the-existing-table-in-laravel-migration-24

Jun
30
4 months ago
Activity icon

Replied to Sum Per User

What you are getting now in this code?