Tagged: 5.8

global variable for all controller and views in Laravel 0

global variable for all controller and views in Laravel

Today, We want to share with you global variable for all controller and views in Laravel.In this post we will show you set global dynamic variables in Laravel 5.8, hear for Laravel define global constants Config php file we will give you demo and example for implement.In this post, we will learn about How to set a variable inside Laravel’s blade template with an example.

global variable for all controller and views in Laravel

There are the Following The simple About global variable for all controller and views in Laravel Full Information With Example and source code.

As I will cover this Post with live Working example to develop How to define Global Variables in Laravel 5.8?, so the Laravel 5.8 – global and dynamic variable for this example is following below.

How to create global variable in laravel 5.6?

config/global.php

set simple your array here.

return [
  'website_title' => 'pakainfo Blog',
  'pagination' => 10,
  'tagLine' => 'Welcome to pakainfo website Love You',
  'API_KEY' => 'hjh566s5df$#FDsf45f4df7ds8ds',
];

Use in your laravel blade view file.

{{ config('global.website_title') }}

{{ config('global.tagLine') }}

Web Programming Tutorials Example with Demo

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about global variable for all controller and views in Laravel.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Simple PHP Laravel Pagination script 0

Simple PHP Laravel Pagination script

Today, We want to share with you Simple PHP Laravel Pagination script.In this post we will show you Laravel Pagination Example Tutorial, hear for Laravel 5.8 – Pagination Link Customizations Example we will give you demo and example for implement.In this post, we will learn about Laravel 5.8 – Customizing pagination templates with an example.

Simple PHP Laravel Pagination script

There are the Following The simple About Simple PHP Laravel Pagination script Full Information With Example and source code.

As I will cover this Post with live Working example to develop laravel pagination with search, so the laravel pagination parameters for this example is following below.

Laravel Pagination with Query Builder

app/Http/Controllers/ProductController.php


public function index()
{
    //Laravel pagination - Query Builder
    $products = DB::table('products')->paginate(12);
    return view('product.index', ['products' => $products]);
}

app/Http/Controllers/ProductController.php


public function index()
{
    //simple pagination
    $products = DB::table('products')->simplePaginate(12);
    return view('product.index', ['products' => $products]);
}

Laravel Pagination with Eloquent ORM

app/Http/Controllers/ProductController.php

public function index()
{
    //eloquent
    $products = Product::paginate(12);
    return view('product.index', ['products' => $products]);
}

app/Http/Controllers/ProductController.php

public function index()
{
    //simple pagination (eloquent)
    $products = Product::where('category', 'Laravel')->simplePaginate(12);
    return view('product.index', ['products' => $products]);
}

Laravel Displaying Pagination Results

<div class="container">
    @foreach ($products as $product)
        {{ $products->title }}
    @endforeach
</div>

{!! $products->render() !!}

Web Programming Tutorials Example with Demo

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Simple PHP Laravel Pagination script.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Clear All Cache From Laravel project 5.7 0

Clear All Cache From Laravel project 5.7

Today, We want to share with you Clear All Cache From Laravel project 5.7.In this post we will show you How to clear config cache in Laravel using Artisan, hear for Laravel 5.7 clear cache from route, view, config and all cache data from application we will give you demo and example for implement.In this post, we will learn about Laravel Clear Cache – How to Clear Cache on Views, Config, Route, etc with an example.

Clear All Cache From Laravel project 5.7

There are the Following The simple About Clear All Cache From Laravel project 5.7 Full Information With Example and source code.

As I will cover this Post with live Working example to develop Clear All Cache From Laravel project 5.7 in controller using route, so the laravel clear bootstrap cache Laravel Clear cache Tutorial With Example for this example is following below.

Laravel 5.7 Clear all cache Examples

laravel clear config cache Example with Laravel Clear Cache Commands

Clear Config cache using Laravel

php artisan config:cache

Laravel Clear View cache

php artisan view:clear

Clear Laravel Route cache:

php artisan route:cache

Clear Cache in Laravel facade value

php artisan cache:clear

Reoptimized class loader in Laravel

php artisan optimize

Laravel 5.7 Clear cache in shared hosting server

Route::get('/clear-cache', function() {
    $exitCode = Artisan::call('cache:clear');
    // return what you want
});

We can check the Main Website official doc here http://laravel.com/docs/5.0/artisan#calling-commands-outside-of-cli

Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Clear All Cache From Laravel project 5.7.
I would like to have feedback on my Pakainfo.com blog for Clear All Cache From Laravel application 5.7.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.