Laravel pagination

Friends, many times what happens is that there is a lot of data in our return database table, meaning it is in thousands and lakhs and when we bring it…

0 Comments

Owl Carousel

<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.min.css"> <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.theme.default.min.css"> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/owl.carousel.js"></script> <!-- Demos --> <div class="owl-carousel owl-theme"> <div class="item"> <h4>1</h4> </div> <div class="item"> <h4>2</h4> </div> <div class="item"> <h4>3</h4> </div>…

0 Comments

Orderby in laravel

Sometimes we need to use orders to get the data from database like order by date order name order by create extra. In this snippet, we’re using Laravel Eloquent to fetch…

0 Comments

Blog post crud in laravel

A. Fetch Posts : Controller: public function posts(){ $categoriesdata=Category::orderBy('id','desc')->get(); if(isset($_GET['search'])){ $search=$_GET['search']; $postsdata= DB::table('posts') ->leftjoin('categories', 'categories.id', '=', 'posts.category') ->select('posts.*', 'categories.id as categories_id', 'categories.name as categories_name') ->where('posts.title', 'LIKE', '%' . $search .…

0 Comments