Thouhedul Islam

I speak PHP, Laravel, MySql, JavaScript, VueJS, Python, Bengali and English. I am originated from Bangladesh, currently working in Malaysia.

How to do Laravel Order by Relationship Field

If you are stuck for Laravel Order by Relationship Field, this post may be helpful for you to sort it out. View the code on Gist. Here, we can sort out item types.   Now, if you need to add with() method, you can apply here too. View the code on Gist.   Hope, it…

Read more...

Laravel Full Text Search Tutorial

If you are looking for a Laravel full text search, this tutorial might be helpful for you. In order to make full-text search, you need to add a column index called FullText. Imagine that we are going to use model User as a full-text search. So, we are planning following field to be searched as a…

Read more...

How to add values to Request array in Laravel

If you want to add values to Request array in Laravel, here is the easiest way you can follow. View the code on Gist. Hope it will work for you.

Read more...

How to upload files via SSH from Mac

If you are looking for how to upload files via SSH from Mac, this tip may be helpful for you. What you need SSH Access to your server File / folder that you want to upload Terminal   Now open your terminal and type- scp -r /the/full/path/of/your/folder/or/file/at/local/computer [email protected]:/folder/where/you/want/to/uploadhtml/api Here- /the/full/path/of/your/folder/or/file/at/local/computer means the folder you want…

Read more...

How to disable Laravel default timestamp

If you want to disable Laravel default timestamp (created_at or updated_at), here are the tips. Disable globally: If you want to disable globally, you need to go to base model and define timestamp false as follows- public $timestamps = false;   Disable individually: In some cases, maybe you need to stop individually. In this case,…

Read more...

Laravel Vue-Resource pass parameter in Get Method

Here is the small trick that, how to pass a parameter in Get method for Laravel Vue-Resource. View the code on Gist.   So, here you need to use params attribute, that’s all.  

Read more...

How to start Laravel as a fresh

Are you new at Laravel? Do you have the same question that, how to start Laravel? I strongly believe that it’s normal to everyone, you, me, and other devs those are good at laravel.   So, I have few recommendations for newcomers at laravel. Today, I am sharing with you guys. A guidebook cannot be an…

Read more...

How to set laravel custom primary key

Imagine you have an id in your table called product_id that you want to be as a primary key instead of id. In this scenario, you can set your custom primary key in your model.   View the code on Gist. Now you are able to use product_id as a primary key of the Product model.

Read more...

How to use laravel wherebetween together

Using Laravel whereBetween is tricky in some cases. Normally laravel wherebetween takes two arguments to check. Let’s check how to do that. Just simply use- $reservations = Reservation::whereBetween(‘reservation_from’, [$from, $to])->get(); Now imagine that you need to use more condition on that. $reservations = Reservation::whereBetween(‘reservation_from’, [$from_from, $to_from]) ->orWhereBetween(‘reservation_to’, [$from_to, $to_to]) ->get(); Hope it will work.

Read more...

Laravel Call to undefined method App\Exceptions\Handler::unauthenticated()

If you are facing problem in Laravel Call to undefined method App\Exceptions\Handler::unauthenticated(), this post might be helpful for you. It happens because unauthenticated function somehow missing from error handler. Go to App\Exceptions\Handler.php file and add the following function. View the code on Gist.   Make sure top of your class, you have used use Illuminate\Auth\AuthenticationException as AuthenticationException;…

Read more...