Laravel 7.x and 6.x check if file uploaded or not using hasFile or isValid

It is very easy to check if uploaded file or image empty or not if you are using core PHP. But as we know laravel 5 provide us object of file, So we can not determine using empty(). However, we can simply do it using hasFile() and isValid() of laravel predefine. So i am going to give you basic example of both function one by one. So let's simply see both example and use it. <strong class="step-up.....

Posted On July 16, 2017

Laravel 7.x and 6.x global variable in all views file

Here, i will let you know how to set global variable in laravel 5 application. In this article i will set globle variable two way on simple view share and another using composer view share. As we know, every webiste or project there are several things are comman and access it in every page like footer text, logo, site title etc. So it is necessary to define it one time and access it on all views .....

Posted On July 16, 2017

Disable timestamps(created_at and updated_at) in Laravel 5 Model

As we know, Laravel added two field "created_at" and "updated_at" with timestamps. So when new record will be add then created_at and updated_at columns update current timestamps updated and when update then update then updated_at column. This is a default by laravel. But sometime, we dose not need to add created_at and updated_at column. So we have to stop add update those column, otherwise it r.....

Posted On July 11, 2017

Search comma separated value using find_in_set() in Laravel 5 Example

Here is a crazy example today, how to use find_in_set() mysql function in laravel query builder. If you need to add tags or something that store as comma separated values in database column, then you can simply store but if also need to search then it can be hard. Like if you have posts table with tags column you simply store data like "laravel,php,html" etc comma separated string then how you fo.....

Posted On July 9, 2017

PHP Laravel subquery in select statement example

I don't remember exactly, but i was working on my laravel 5+ application 2 months ago. At that moment i require to write subquery in select statement. I simply write in my mysql query and check it's work perfect. But i though how can it possible to write using laravel query builder. So first i am going to explain what was that. I have two tables <strong>"posts"</strong> and <strong>"post_viewer".....

Posted On July 9, 2017

PHP Laravel change date format example

Sometime, we may require to change date format in laravel view file or controller, so you can change your date format using carbon, date, strtotime. Here i gave you three example of change dateformat of timestamp column. In this example i have simple users table with id, name, email, created_at and updated_at column. In created_at column we store timestamp value like "Y-m-d H:i:s" and here i will.....

Posted On July 9, 2017

How to change log file path in Laravel 7.x and 6.x?

In Laravel framework, they store all error store in logs file and they keep in storage folder. Logs will help to find where is error and why in details. Because in every exception it put automatically in log file. You can also put manually log like as bellow few examples: <pre> Log::info('Info Log'); Log::alert('Alert Log'); Log::error('Error Log'); </pre> As above and there are others also avail.....

Posted On July 7, 2017

How to send email using gmail in PHP Laravel 7.x and 6.x?

Laravel is very popular framework of php in todays. Laravel is famous because they provide several goods things like MVC, routing, mail etc. In this article we will learn how to send email using SMTP driver. Laravel 5 provide several drivers options like SMTP, Mail, SendMail and services supported include Mailgun, Sendgrid, Mandrill, Amazon SES, etc. So, here i will let you know how to send email.....

Posted On July 7, 2017

How to remove file if exists from folder in Laravel 7.x and 6.x?

We almost require to file upload or image upload function in our laravel application. We simply make image upload functionality and put that image om our upload directory. But when record will delete from database then it should be remove from folder too otherwise there are several useless images store. So, in this article i will let you know how to check file exists or not then delete image or .....

Posted On July 6, 2017

Laravel 7.x and 6.x - Summernote Wysiwyg Editor with Image Upload Example

Summernote Wysiwyg is very simple and cool editor. If you use simply textarea and you require to make more tools like bold, italic or image upload, Then you have to choose Summernote plguin. In this article, i will let you know how to use summernote editor in our laravel 5 application. In this example i am going to use summernote with bootstrap. So you can simply use summbernote editor. If you .....

Posted On July 5, 2017

Blog Search

Copyright © 2020 HDTuto.com. All rights reserved.