tisuchi

Member Since 4 Years Ago

Dhaka, Bangladesh

Sr. Software Engineer at Avana

Experience Points 410,855
Experience Level 50

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 1474
Lessons
Completed
Best Reply Awards 275
Best Reply
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    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 Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

21 Jun
4 days ago

tisuchi left a reply on Email Validation In API.

@LARAVEL007 - Yes, that's what I mean.

Security shoudn't be the biggest concern here because you are just getting a hash to cross-check with DB and then update the data, nothing else.

tisuchi left a reply on Email Validation In API.

I believe in that case, you need to put your activate-manager route code in web since you are trying to access this via web browser.

15 Jun
1 week ago

tisuchi left a reply on How To Use Comma Inside Foreach Loop?

@laravel007

If your intention is to show comma after each element except the last one, you can easily use $loop->last() inside your foreach. I think it will help to fix your issue.

Check this code-

@foreach(explode(', ', $scholarship->selected_subjects) as $subject)
    <a href="{{ route('subjects.show', $subject) }}">
        {{ $subject }} ,
    </a>

    @if( !$loop->last)
        ,
    @endif
@endforeach

Read more: https://laravel.com/docs/5.8/blade#the-loop-variable

11 Jun
2 weeks ago

tisuchi left a reply on L5.2 [ReflectionException] Class 'ClassName' Does Not Exist

@CAC - Actually, you are right. It supposes to be \\ but it shows single only. I already update my code. Make sure that you have the same code now.

tisuchi left a reply on How To Add Extra Values In Every Result?

@laravel007

There can be few ways to solve your issue. However, I think the easiest way is to add a random temporary number in the view part while you are not storing this data anywhere else.

For example, if you have a users collection in your view, the code can be like this-

@foreach($users as $user)
    {{ $user->temp_code .'-'. \Str::random(4) }}
    // other code inside the loop
@endforeach

tisuchi left a reply on WhereIn Not Working As Expected.

@MOHAMMADBASIR - There are two issues here-

  1. You haven't use the get() so that you are getting this error.

  2. whereIn() allows the integer value only, you have passed the string. You need to work with id instead of name here.

So, the right code should be like this-

public function index(Request $request)
{
        return \App\User::whereIn('id', [1, 2])->get();
}

tisuchi left a reply on WhereIn Not Working As Expected.

It's because you probably pass a string instead of integer in the whereIn().

You better show your whereIn code.

tisuchi left a reply on Class App\Http\Controllers\ValidationsController Does Not Exist

Two suggestions for you.

Firstly, make sure you have the right spelling ValidationsController in the file name and class name.

Secondly, if you have passed the first point, then run the following commands-

composer dump-autoload
php artisan cache:clear 

tisuchi left a reply on Why Getting 404 Error?

@RUHULAMIN - If I get your code correctly, you suppose to get Method not found exception because you have declared Route::post().

If you use get() instead of post(), I think it will fix your issue.

Route::get('admin/posts', '[email protected]');

tisuchi left a reply on Why Getting 404 Error?

@ruhulamin

Check whether other endpoints are working or not.

And it will be better to show your code instead.

10 Jun
2 weeks ago

tisuchi left a reply on L5.2 [ReflectionException] Class 'ClassName' Does Not Exist

@cac

First of all, psr-4 link suppose to be like this-

"psr-4": {
            "App\": "app/"
        }

So, your full code is like this-

"autoload": {
        "classmap": [
            "database",
            "app/Http/Controllers",
            "app/Models",
            "app/Console/Commands"
        ],
        "psr-0": {
            "scdda": "app/"
        },
        "psr-4": {
            "App\": "app/"
        }
    }

It should work now.

In some cases, composer dump-autoload may be required. If you are facing same issue still, run

composer dump-autoload

tisuchi left a reply on What Is The Best API Designer?

@shantodev

There is a lot of option that you can choose.

Personally, I used to swaggerhub that was fine until the project becomes bigger. We feel maintaining the big project is quite difficult with swaggerhub.

Then I discover the StopLight, that's slogan is 10 times faster than swaggerhub. Although in order to use full feature of stoplight, you have to pay, however, the basic uses of stoplight could be one of the best choices of mine personally. Still, I am using StopLight in my project.

Note: Both of these fulfill your requirements.

08 Jun
2 weeks ago

tisuchi left a reply on Get Replies Count And Reply Likes Count With A Trainer

@KANE - Why not you use relatinship if it suits?

tisuchi left a reply on How To Protect Laravel Website?

Can you share your site url? So that we can check it out here.

tisuchi left a reply on Looking For Some Good Laravel Interview Question.

@shantodev

I personally explore these questions. I think it's one of the good resources.

Besides, some standard discussion about laravel interview is in the reddit group. You can check it out there too...

https://www.reddit.com/r/laravel/search/?q=interview &restrict_sr=1

tisuchi left a reply on Creating A Demo User Account For Web Visitors?

I have a rough idea. You may think of a user role in that situation.

A demo role user should have a read-only accessiblity.

If you don't want to go for board sense, you may simply use a middleware, that you have thought already. Just restrict / allow them in specific routes.

tisuchi left a reply on Ho To Sorting Related Articles Based On Common Tags?

@aarad

Basically whereIn() works with an array of id.

You may simply create another method in your article then filter the related articles via that method. Then, in your $relatedArticle, you just call this easy to get the related content.

tisuchi left a reply on What Is A Middleware?

Basically, the Middleware is a middleman between request and response. It is a type of filtering mechanism. For example, Laravel includes a middleware that verifies whether the user of the application is authenticated or not. If the user is authenticated, he will be redirected to the home page otherwise, he will be redirected to the login page.

You will get many examples of middleware on the internet. However, Jeffrey has a good episode on Middleware too. I think you can take a look that also. https://laracasts.com/series/laravel-from-scratch-2018/episodes/25

tisuchi left a reply on Looking For Your Suggestion.

hmm...

First of all, you can use some build in packages for getting user's data. I think there are a few good packages available besides Google analytics.

Secondly, if you don't want to use any package for that, then you can use fingerprint() build in a method in laravel. I guess it will help you. The fingureprint method is in the request trait.

You can use it like this way-


public function yourMethodName(Request $request){

    $uniqueUser= $request->fingureprint();

}

This fingureprint() will return a unique code for every user. Doesn't matter in which browser or how many tabs you are using. It should be the same for each computer.

tisuchi left a reply on Laravel Model Is Not Working

@RUHULAMIN - I see.

It's because you are not following the proper naming convention. Your table name should be posts.

In that case, you can just add a custom table name in your model.

class Post
{
    protected $table = 'post';

    public function index(){

    }
}

It should work.

tisuchi left a reply on Laravel Model Is Not Working

Most probably it's because of your table name is not following the same naming convention. You better show your code.

tisuchi left a reply on How To Get User's IP Address?

Basically, Request trait provide you user's details out of the box. You can easily get it. For example-

public function index(Request $request)
{
    $userIp = $request->ip();
        $userAgent=  $request->userAgent();
}

And of course, you will get more methods out of the box. Check in Illuminate\Http\Request file.

29 May
3 weeks ago

tisuchi left a reply on Phpunit Configuration Refresh My Database

@WIZJO - It seems that your user migration table have some issue. May be you can share your code.

Meanwhile, you can do this for refreshing your database.

class ExampleTest extends TestCase
{
    use DatabaseMigrations;
    use RefreshDatabase;

tisuchi left a reply on Forcing A Unique Rule To Ignore Multiple IDs

@thefundi

I cannot understand how-

this can open my application up to SQL injection

Can you show your update code instead?

tisuchi left a reply on Grammar::columnize() Must Be Of The Type Array

Its because get() expect array as a parameter, you provided a string. You need to update all by making as an array.

public function shopBankList($shopId, $fields = 'all')
    {
        return Shopbank::where('shop_id', $shopId)
            ->get( $fields == 'all' ? ['*'] : $fields );
    }

It may work now.

tisuchi left a reply on Its Look Like Laracasts.com Is Now A PWA Web App.

@MADAMMAYA - It's too wired to spam here.

28 May
4 weeks ago

tisuchi left a reply on 500 Server Error

You should able to see 500 error details in storage/logs folder. There should be either laravel.log or laravel-yyyy-mm-dd.log file. Check why exactly you are facing this issue.

tisuchi left a reply on How To Initialise Filed In PHPStorm?

I use mac, and it's opt + return.

tisuchi left a reply on Any “famous” Sites Built With Laravel?

I just want to enrich the big website list those are on laravel. Personally, I work for all of these project and I know the technology.

  • avana.asia (Was on Symfony, now moving to Laravel)
  • sugarbook.com (Completely on Laravel)
  • scholarshipunion.com (Completly on Laravel)
  • hotelchamp.com (Running on Laravel)

And of course, many other sites are using Laravel those are serving hundreds of thousands of visitors in every day.

tisuchi left a reply on I Want If User Register Successfully Then User Will Come Next Time The Registration Will Not Be Show For That User.

You can use middleware in your route.

Route::get('register', '[email protected]')->middleware('guest');

In your controller, you can use condition too-


public function YourMethod(){
    
    if (Auth::check()){
        // return to logged in user page
    }

    // return to the guest user page. 
}

27 May
4 weeks ago

tisuchi left a reply on Auth Not Found Issue

@hasibweb

You forgot to import the Auth top of your class. It should be like this-

use Auth;

tisuchi left a reply on I Am New At Laravel. What Should I Do?

Firstly, welcome to Laravel world. I think you are in the right place.

I already answered this question. You just check the following link-

https://laracasts.com/discuss/channels/tips/new-to-laravel-6

tisuchi left a reply on How To Get Postman Post Data?

You can use Request to get form data from the postman, that is as like as a web form.

$request->input('shopId');
25 May
1 month ago

tisuchi left a reply on Trying To Get Property Of Non-object

You can use optional() in this case. I think it will fix your issue. Try with this-

<textarea name="others" class="form-control" placeholder="Tell more about you.">{{ optional($user->profile)->others }}</textarea>
22 May
1 month ago

tisuchi left a reply on Why Carbon Format Not Working?

First of all, created_at and updated_at is already carbon instance. You don't need to parse those columns.

Now, you can easily format this like this way-

{{ $user->created_at->format('d-m-y');

tisuchi left a reply on How Can I Learn Design Pattern Easily?

There is no shortcut way to learn design pattern easily. lol...

You can check this series. https://laracasts.com/series/solid-principles-in-php

21 May
1 month ago

tisuchi left a reply on Getting The Value Of Date (Y:M:D)?

@AP3TWE - It's in the controller. You can use it in the view as well.

tisuchi left a reply on How Do I Get The Updated_at

@AP3TWE - As long as the project is there, this condition should return true all the time.

@if ($project->updated_at)

So, else is redundant here. How is your method's code?

tisuchi left a reply on Laravel Premium Package

@YASSINEQORAICHE - I see. That's a critical question. I am not so sure how do you fix that issue. :(

tisuchi left a reply on Laravel Premium Package

You have to subscribe @yassineqoraiche. There is no other way to use.

tisuchi left a reply on Getting The Value Of Date (Y:M:D)?

@AP3TWE - BTW, I have tested your code. If I pass the code like this way, it works fine.

$user = User::first();

return \Carbon\Carbon::parse($user->created_at)->format('d-m-Y');

What is the purpose of wrapping this code by attribute method?

tisuchi left a reply on How Do I Get The Updated_at

Show your updated code. You can return your updated_at value from the method to view.

tisuchi left a reply on Eloquent ORM Nested Eager Loaded Relations

You better show your method code for better understanding.

tisuchi left a reply on Getting The Value Of Date (Y:M:D)?

What if you try this way?

Carbon\Carbon::createFromFormat('d-m-Y', '2019-05-15 20:38:42');

tisuchi left a reply on SQLSTATE[HY000]: General Error: 1364 In LARAVEL 5.7

I think this line is problematic. $project->create(request($valid_data));

You are getting validated data into $valid_data variable already. So, there is no point to use request($valid_data) again.

It should be like this-

        $project->create($valid_data);

FYI, I haven't tested your code yet.