顯示具有 lavavel 標籤的文章。 顯示所有文章
顯示具有 lavavel 標籤的文章。 顯示所有文章

星期日, 5月 21, 2017

[Lavarel] 使用View::exists 判斷view blade是否存在

記錄一下為了做樣版切換機制需要用到的View:exists方法 http://stackoverflow.com/questions/32102272/how-to-include-a-blade-template-only-if-it-exists You can use View::exists() to check if a view exists or not. @if(View::exists('path.to.view')) @include('path.to.view') @endif Or you can extend blade and add new directive Blade::directive('includeIfExists', function($view) { });

星期一, 12月 19, 2016

[Lavavel] Laravel 5.2 could not open laravel.log

今天跑seed的時候發生laravel.log無法打開的錯誤。
找到StackFlow的解法如下:

http://stackoverflow.com/questions/35715400/laravel-5-2-could-not-open-laravel-log
Try the following commands on your shell:
  1. Clear Laravel cache and the compiled classes
    php artisan cache:clear
    php artisan clear-compiled
  2. Change the storage and cache directories permission
    sudo chmod -R 777 storage
    sudo chmod -R 777 bootstrap/cache
  3. Regenerate the composer autoload file
    composer dump-autoload

[Lavarel] elixir verison 爆掉

試一下version()方法來做版控就爆了

SyntaxError: Unexpected token s in JSON at position 41

at Object.parse (native)

at VersionTask.deleteManifestFiles (/var/www/你的專案/node_modules/laravel-elixir/dist/tasks/VersionTask.js:113:29)


如果遇到version錯誤的話,記得把public/build/rev-manifest.json的格式產生異常了,

可以手動修正。


星期三, 10月 19, 2016

[Laravel] 如何設定 lavavel elixir載入bootstrap的樣式

記錄一下如何在lavavel elixir載入bootstrap的樣式

基本載入

只需要簡單的二個步驟即可

Step1:

原本的專案內 resources/assets/sass/app.scss
會看到以下這個,拿掉原本的註解即可


  Step2:

打開gulpfile修改如下,使用方法為mix.sass的 webpack loader即可,其他code是自已專案的範例


客製化



參考


https://laravel-news.com/2015/10/setup-bootstrap-sass-with-laravel-elixir/

其他你感興趣的文章

Related Posts with Thumbnails