HDTuto.com

PHP


How to get http hostname in Laravel?

A very few days ago i was trying to get hostname in my laravel 5.7 app. i read whole document of request but i didn't get where to get host name in my controller. But i found solution for that we can easily get http host name from request object and helper that way you can easily get domain name or sub domain name too. request provide two methods to get hostname as getHttpHost() and getHost(). Y.....

Posted On November 16, 2018

Laravel 5.7 - Multiple Authentication Example

Hey Guy, Today topic is multi auth in laravel 5.7 application. I will show you how to integrate multiple authentication in laravel 5.7 project. sometime we require to make two septate login one for user and another for admin. Multiple authentication will required when you are provide service like real estate website in laravel 5.7. If you work on large web application then you mostly prefer to di.....

Posted On October 25, 2018

Form Validation Example with Laravel 5.7

Here, we will learn how to create form validation with error message in laravel 5.7 application. form validation is a primary requirement of every project. laravel 5.7 provide very simple way to use form validation like required, password, same, eamil, number, array, file, mime types etc. Here, i am going to show you very simple example of form validation so, you can simply use in your laravel 5......

Posted On October 19, 2018

JQuery Ajax Post Request Example in Laravel 5.7

we are all familiar with ajax post and get request and i think we also use ajax request with jquery many times and many project may be. But in this project i will show you how to use jquery ajax request in laravel 5.7 application. You can simple implement ajax post request with pass form data and you can access post data to controller. You have to just do three things to understand how to use aja.....

Posted On October 17, 2018

Laravel 5.7 - get all eloquent query log example

Hey Guys, Here, we will learn how to get last query log in laravel 5.7. if you are a laravel developer then we know we always need to print last sql query log and need to debug queries where is a issue?. So, in this post i am going to give you three way to capture last query log and print in laravel 5.7 application. So, you can simply use any one for debug your application. <strong class="step-up.....

Posted On October 17, 2018

How to implement datatables in Laravel 5.7?

In this artical, i will show you how to use datatables in laravel 5.7 project. we will use yajra laravel-datatables-oracle for datatables in laravel 5.7. now we will create simple example for datatable, so you will get idea how i can use ajax too for datatables in laravel 5.7. DataTables is a powerful plug-in for the jQuery Javascript library. It is a highly flexible tool, build upon the foundati.....

Posted On October 4, 2018

Laravel 5 - Call to middleware from controller method

In this post, i will let you know to call middleware from controller method using $this-middleware. Here i will show you constructor for adding middleware for each method like index, create, store, edit, delete, show and update of controller. You can see bellow code how we can use middleware in your controller file. It might be help to use middleware with "only" or "except" method too. <strong>.....

Posted On September 28, 2018

How to get current user details in Laravel 5.7?

Here, i will let you know how to get current logged in user in laravel 5.7 app. you can get current user id in controller, view files. we will user auth() helper and Auth facade class to get current user data. we always require getting current logged in user data in laravel 5.7 application. I will show you how to get current user data like name, id, email, address etc by using laravel 5.7 auth. I.....

Posted On September 28, 2018

How to get last inserted id in Laravel 5.7?

we can get last insert id in three way to into laravel 5.7 application. laravel provide three model function to get current saved record id as save(), create() and insertGetId(). If you have experience with PHP Project developing then you know we almost require to get last id. so if you need to get last insert id then you can get save(), create() and insertGetId() method in laravel 5.7 project. h.....

Posted On September 25, 2018

Laravel 5.7 Get Current URL with Parameters

Hi Developer, In this small post, i wanted to show you how you can get current url or base url with parameters in your controller file or blade view file of laravel 5.7 project. So laravel 5.7 provide several way to get current app path using fullUrl(), current(), url() and segment() of request object. You can easily get by request object. Laravel 5.7 provide Request and URL facade for getting re.....

Posted On September 25, 2018