北漂张小白

1949 经验值

嗯嗯,自己犯二了!解决了!

使用 @include('editor::head')

为什么会 多加载http://cdn.bootcss.com/bootstrap/3.3.0/css/less/navbar.less 这个文件?

导致我的页面样式都乱了!!!!

是代理的问题,但是我重新设置了代理又产生了新的错误:
代理我是这样设置的:

npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080

新的错误如下:

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the @ development script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/zhangchunbo/.npm/_logs/2017-06-28T14_26_52_322Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @ dev: `npm run development`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the @ dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/zhangchunbo/.npm/_logs/2017-06-28T14_26_52_350Z-debug.log

错误信息如下:

Error: Cannot find module '/Users/zhangchunbo/www/coding98/node_modules/laravel-mix/setup/webpack.config.js'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at requireConfig (/Users/zhangchunbo/www/coding98/node_modules/webpack/bin/convert-argv.js:96:18)
    at /Users/zhangchunbo/www/coding98/node_modules/webpack/bin/convert-argv.js:109:17
    at Array.forEach (native)
    at module.exports (/Users/zhangchunbo/www/coding98/node_modules/webpack/bin/convert-argv.js:107:15)
    at Object.<anonymous> (/Users/zhangchunbo/www/coding98/node_modules/webpack/bin/webpack.js:153:40)
    at Module._compile (module.js:571:32)

npm ERR! Darwin 15.0.0
npm ERR! argv "/usr/local/Cellar/node/7.9.0/bin/node" "/usr/local/bin/npm" "run" "development"
npm ERR! node v7.9.0
npm ERR! npm  v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ development script 'cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs 
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls 
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/zhangchunbo/.npm/_logs/2017-06-28T11_47_29_253Z-debug.log

npm ERR! Darwin 15.0.0
npm ERR! argv "/usr/local/Cellar/node/7.9.0/bin/node" "/usr/local/lib/node_modules/cnpm/node_modules/.bin/npm" "--userconfig=/Users/zhangchunbo/.cnpmrc" "--disturl=https://npm.taobao.org/mirrors/node" "--registry=https://registry.npm.taobao.org" "run" "dev"
npm ERR! node v7.9.0
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! @ dev: `npm run development`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ dev script 'npm run development'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run development
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs 
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls 
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/zhangchunbo/www/coding98/npm-debug.log

删除node_modules目录重新运行cnpm install报错如下:

⚠ tunneling socket could not be established, cause=connect EHOSTUNREACH 0.0.31.182:80 - Local (192.168.1.103:49803)
  ⚠ mozjpeg pre-build test failed
  ℹ compiling from source

是的,问题解决了,因为访问api的时候没有带apiToken。

为什么$user = Auth::guard('api')->user();打印出来会是null呢?明明登陆了,followers 都能打印出user;

应该是followings_count字段;
我觉得被关注的用户followers_count +1 的同时,发起关注的用户(当前登陆的用户)followings_count字段是不是也要 +1?
如果followings_count字段不 +1 ,followings_count 一直都是0;

follow() 这个函数里面,是不是需要加上一句这个?Auth::guard('api')->user()->increment('followers_count');

 public function follow()
    {
        $userToFollow = $this->user->byId(request('user'));

        $followed = Auth::guard('api')->user()->followThisUser($userToFollow->id);

        if(count($followed['attached'])> 0 ){
            $userToFollow->increment('followers_count');
            
            Auth::guard('api')->user()->increment('followings_count');
            return response()->json(['followed' => true]);
        }

        $userToFollow->decrement('followers_count');
        return response()->json(['followed' => false]);
    }

如果我不想对followers表里的数据进行删除,想添加一个status字段来区分是否关注,这格式化toggle方法还适用吗?