PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Sun May 31, 2020 1:54 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Sun Oct 04, 2015 1:31 pm 
Offline
Forum Contributor
User avatar

Joined: Wed May 14, 2014 12:18 pm
Posts: 331
Hey guys i am just playing around with laravel and bascally have the following view:

Syntax: [ Download ] [ Hide ]
<!doctype html>
<html class="no-js" lang="">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="x-ua-compatible" content="ie=edge">
        <title>Title</title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="apple-touch-icon" href="apple-touch-icon.png">
        <!-- Place favicon.ico in the root directory -->
        <link rel="stylesheet" href="css/normalize.css">
        <link rel="stylesheet" href="css/style.css">
        <style>
            h1 {
                color: #727272;
               font: bold 2em/1.4 verdana;
            }
            .nav-items {
                padding: 0;
                margin: 0;
                list-style-type: none;
            }
           
            .nav-items li {
                display: inline-block;
                margin-right: 10px;
                padding: 1em 1.5em;
                border: 1px solid #ccc;
               background-color: #eee;
               -webkit-box-shadow: 0 0 2px rgba(0,0,0,.2);
                box-shadow: 0 0 2px rgba(0,0,0,.2);
                color: #727272;
               text-shadow: 0 0 1px rgba(255,255,255,1);
            }
        </style>
   
    </head>
    <body>
        <!--[if lt IE 8]>
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
       
           
           <ul class="nav-items">
               
               @foreach($categories as $category)

                   <li>
                       Category id is {{ $category-> id }}
                   </li>

               @endforeach  

            </ul>
                 
                                       
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
        <script>window.jQuery || document.write('<script src="js/vendor/jquery-1.11.3.min.js"><\/script>')</script>
       
    </body>
</html>
 


Now suppose i change the below code:

Syntax: [ Download ] [ Hide ]
<ul class="nav-items">
               
               @foreach($categories as $category)

                   <li>
                       Category id is {{ $category-> id }}
                   </li>

               @endforeach  

 </ul>
 



To the following:

Syntax: [ Download ] [ Hide ]
<ul class="nav-items">
               
               @foreach($categories as $category)

                   <li>
                       Product id is {{ $category-> id }} // I have only changed the word "Categories" to "Products"
                   </li>

               @endforeach  

 </ul>
 


I have only changed the word Categories to Products , but when my view loads in the browser i still see the word "Category" instead of "Products" .

The only current solution i have is to change the view file name and than change the view name in the controller, which is quite inconvenient ! , Is there another solution to this problem ? Is this something to do with caching ?


Top
 Profile  
 
PostPosted: Sun Oct 04, 2015 2:18 pm 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6425
Location: Montreal, Canada
Refreshing your browser should be enough. I generally develop in a separate browser that always runs in private mode so as not to have to deal with caching, cookies, etc. Finally, you can run "artisan cache:clear"

_________________


Top
 Profile  
 
PostPosted: Sun Oct 04, 2015 2:37 pm 
Offline
Forum Contributor
User avatar

Joined: Wed May 14, 2014 12:18 pm
Posts: 331
Will try that thanks :)


Top
 Profile  
 
PostPosted: Fri Feb 05, 2016 1:25 am 
Offline
Forum Newbie

Joined: Thu Feb 04, 2016 2:19 am
Posts: 7
Hey, try this code to disable caching:

If you run php artisan list then you can find all the commands available for artisan, anyways, there is a command to clear the cache and it's
php artisan cache:clear
Also, you can use
foreach (Cache::getMemory() as $cacheKey => $cacheValue)
{

Cache::forget($cacheKey);
}
Update:
Cache::flush();


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group