HDTuto.com

Laravel


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

Laravel 5.7 multiple file upload with validation example

In this post, i will show you step by step how to multiple file upload in laravel 5.7 application. we also learn how to add validation with multiple file uploading in laravel 5.7 app. Using this example, you will get idea to upload multiple images with laravel 5.7. We are going from starch so, we will upload multiple file and store on server then after we will store database too. so in this exa.....

Posted On September 20, 2018

PHP Laravel 5 Union query Example

Hi Guys, Are you looking for how to use union in laravel query builder? If yes then you are a right place. Here i will show you example of union query in laravel 5 project. You can simply user union mysql query by using union() of laravel eloquent. Here i write union query for two tables and get both tables data like as bellow query result: <strong>Example:</strong> <pre> $silver = DB::table("pr.....

Posted On September 18, 2018

Calculate age from date of birth in Laravel

Hi Guys, Today, we will learn to calculate age from birthdate in laravel application. we will use carbon to calculate age in laravel. Actually, yesterday i was working on my laravel 5 application and i require to display age from date of birth in laravel project. I thought i need to use date helper function on php. but i found carbon to calculate age in laravel and we don't require to install c.....

Posted On September 11, 2018

Email Verification in laravel 5.7 Example

Are you looking to verify email address setup in laravel 5.7, then you are a right place. In this tutorial i will example how to setup email verification in laravel 5.7. Few days ago laravel introduce new version 5.7, Then provide email verification after registration in new feature of laravel 5.7. Laravel provide auth to create login, registration by default. But if you want to also add email ve.....

Posted On September 11, 2018

Laravel 5.7 get ip address

In this article, I will let you know how to get ip address from a request in laravel 5.7. Sometime we may require to get client ip address from request object in our laravel 5.7 application. If you are use core PHP and you can get from $_SERVER, but laravel framework provide very simple easy way to get client ip address from request. Here, bellow i gave you example how you can get ip address. yo.....

Posted On September 7, 2018

Laravel 5.7 Image Upload with Validation Example

Hi Guys, Today, i will show you how to create simple image upload in laravel 5.7. I write article step by step about image upload in laravel 5.7 version. I also added validation with image upload in laravel 5.7. I added image upload validation like image, mimes, max file upload etc, So you can easily understand and you it simply. In this post, we will create two routes one for get method and ano.....

Posted On September 5, 2018

Laravel 5 Passing Variable to Javascript Example

In this small article, I will let you know how to pass a variable to jquery in laravel. We always require to get data from laravel model eloquent and pass that variable to javascript. We almost require to pass array variable to javascript in laravel like calender, chart, google map etc. So when you require to print php variable in js then you can do it easily. Here, i will simple get all users f.....

Posted On August 18, 2018