星期日, 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
找到StackFlow的解法如下:
http://stackoverflow.com/questions/35715400/laravel-5-2-could-not-open-laravel-log
Try the following commands on your shell:
- Clear Laravel cache and the compiled classes
php artisan cache:clearphp artisan clear-compiled - Change the storage and cache directories permission
sudo chmod -R 777 storagesudo chmod -R 777 bootstrap/cache - 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的格式產生異常了,
可以手動修正。
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的樣式
原本的專案內 resources/assets/sass/app.scss
Step2:
打開gulpfile修改如下,使用方法為mix.sass的 webpack loader即可,其他code是自已專案的範例
https://laravel-news.com/2015/10/setup-bootstrap-sass-with-laravel-elixir/
基本載入
只需要簡單的二個步驟即可
Step1:
會看到以下這個,拿掉原本的註解即可
Step2:
打開gulpfile修改如下,使用方法為mix.sass的 webpack loader即可,其他code是自已專案的範例
客製化
參考
https://laravel-news.com/2015/10/setup-bootstrap-sass-with-laravel-elixir/
訂閱:
意見 (Atom)


