HDTuto.com

Laravel 5


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

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 Eloquent - When Case Statement in Select Query Example

In this article, you will learn how to use if else condition in laravel select query using db raw. We require many times to add if condition in laravel eloquent query using when case statement. So, In mysql, if you want to add else if condition then mysql provided when case statement. we can use it same way as we use if else. Actually, I was read laravel documentation and i was trying to run some.....

Posted On August 14, 2018

Laravel Validation required if other field empty example

We know laravel provide several in-built laravel validation like required_if, required_without etc. If you need to add validation rules like required if other field is empty in laravel then you can do it using required_if or required_without. I am going to explain you, If you give profile image uploading in your user profile page then if already added profile image then you do not need to upload .....

Posted On August 13, 2018

Laravel - Vue JS File Upload Example

In this artical, i will let you know how to create file uploading with vue js in laravel 5.6 application. Here you will find step by step tutorial of file upload using vue.js in laravel. Here, we will create one post route for file upload and then create one controller. We will write file upload code on controller method. Then after we will make setup for vue js and write component code. We will .....

Posted On August 4, 2018

Laravel - How to generate secure https URL from route?

https is a secure url and we know google give first priority to search that use https. So if you have using http only from scratch and if you install ssl certificate then your website will open with https. So, As we know, If you open with http url then all the links of page will generate with http from route. But if you want to force generate https link from route then you can do it. you can gen.....

Posted On August 3, 2018

Laravel 5.6 - Collection could not be converted to int

Actually, i was working on my laravel 5.6 new project and i require to create dropdown box from database data. I am using laravel "laravelcollective" for select box. I simply created select box with Form::select() element. Then simply i was getting data array using pluck method and i want one black option for just write "Select Form Type", then i simply add following way but i got following error:.....

Posted On July 31, 2018