Category: Laravel
-
Laravel query with or condition between multiple dates check
Hello to all, welcome to therichpost.com. In this post, I will tell you, Laravel query with or condition between multiple dates check. Like I always say that laravel is the best Mvc php framework. Here is the working and tested query for laravel or conditions between multiple dates: $bookingChk = DB::table(‘users’) ->select(‘id’) ->where(‘staff_id’, “=”, $req->staffdetail)…
Written by
-
How to print query in laravel?
Hello to all, welcome to therichpost.com. In this post, I will tell you, How to print query in laravel? Like I always say that laravel is the best Mvc php framework. Here is the working code to print query in laravel: DB::enableQueryLog(); $user = DB::table(‘user’)->where(’email’,’!=’,’test’)->get(); $query = DB::getQueryLog(); $query = end($query); print_r($query); die(); or, you…
Written by
-
Easy way to use transaction in laravel
Hello to all, welcome to therichpost.com. In this post, I will tell you, Easy way to use transaction in laravel. Like I always say that laravel is the best Mvc php framework. DB::transaction() is used for multiple insert queries. I am using it with try and catch and here is working and tested code: DB::beginTransaction();…
Written by
-
How to remove public from laravel url?
Hello to all, welcome to therichpost.com. In this post, I will tell you, How to remove public from laravel url? Like I always say that laravel is the best Mvc php framework.’ Today we will remove public from laravel url and here are the steps: step 1 : copy all file from public and paste…
Written by
-
Laravel Pagination Example
Hello to all, welcome to therichpost.com. In this post, I will tell you, Laravel Pagination Example. Like I always say that laravel is the best Mvc php framework. laravel has default pagination and Laravel’s paginator is integrated with the query builder. Here is the simple and easy way to create laravel pagination: //Controller code <?php…
Written by
-
Upload file in laravel with ajax jquery
Hello to all, welcome to therichpost.com. In this post, I will tell you, How to Upload file in laravel with ajax jquery? Like I always say that laravel is the best Mvc php framework. Laravel file upload with jquery ajax formdata. Here is this post, we will upload file in laravel with ajax and here…
Written by
-
How to use laravel Auth::user() id in query?
Hello to all, welcome to therichpost.com. In this post, I will tell you, How to use laravel Auth::user() id in query? Like I always say that laravel is the best Mvc php framework. In this post, I will tell you to use laravel Auth::user() id in query and here are they: $activated_up = User::where(‘id’,Auth::user()->id)->get(); //or…
Written by
-
How to display the next month laravel?
Hello to all, welcome to therichpost.com. In this post, I will tell you, How to display the next month laravel? Like I always say that laravel is the best Mvc php framework. In this post, I will tell you display the next month laravel and here are they: use addMonth(): Carbon::now()->addMonth(); if you have any…
Written by
-
Laravel Important helpers functions
Hello to all, welcome to therichpost.com. In this post, I will tell you, Laravel Important helpers functions. Like I always say that laravel is the best Mvc php framework. In this post, I will tell you some Laravel Important helpers functions and here are they: optional() The optional function accepts any argument and allows you to…
Written by
-
Get only records created today Laravel
Hello to all, welcome to therichpost.com. In this post, I will tell you, How to Get only records created today Laravel? Like I always say that laravel is the best Mvc php framework. Today, we will do laravel query, which will get only today results: $checkins = Users::whereDate(‘created_at’, Carbon::today())->get(); // select * from `Users` where…
Written by