我已经阅读了文档,其中说如果我想使用,scss
我必须运行以下命令:
ng set defaults.styleExt scss
Run Code Online (Sandbox Code Playgroud)
但是,当我这样做并生成该文件时,我仍然在我的控制台中收到此错误:
ng set defaults.styleExt scss
Run Code Online (Sandbox Code Playgroud)
我该如何解决?
我在Laravel webapp中得到了这个:
@foreach($mentors as $mentor)
@foreach($mentor->intern as $intern)
<tr class="table-row-link" data-href="/werknemer/{!! $intern->employee->EmployeeId !!}">
<td>{{ $intern->employee->FirstName }}</td>
<td>{{ $intern->employee->LastName }}</td>
</tr>
@endforeach
@endforeach
Run Code Online (Sandbox Code Playgroud)
我怎么能检查是否有$mentors->intern->employee
?
当我做 :
@if(count($mentors))
Run Code Online (Sandbox Code Playgroud)
它没有检查.
有没有办法在不重新制作迁移顺序的情况下更改迁移顺序?因为现在我的外键有问题-_-(使用laravel)
如何上传多个文件Laravel 5.3
?如果我尝试使用1张图片,它可以正常工作,但不会上传多张图片.
这是我的代码:
if($request->hasFile('attachment'))
{
foreach ($request->allFiles('attachments') as $file) {
$file->store('users/' . $user->id . '/messages');
}
}
Run Code Online (Sandbox Code Playgroud) 是否可以使用https://github.com/tymondesigns/jwt-auth
获取current user
?因为现在我只能生成一个令牌(当用户登录时).
public function login(Request $request)
{
$credentials = $request->only('email', 'password');
try {
if (! $token = JWTAuth::attempt($credentials)) {
return response()->json(['error' => 'invalid_credentials'], 401);
}
} catch (Tymon\JWTAuth\Exceptions\JWTException $e) {
return response()->json(['error' => 'could_not_create_token'], 500);
}
return response()->json(compact('token'));
}
Run Code Online (Sandbox Code Playgroud) 我在contains
集合https://laravel.com/docs/5.3/collections#method-contains上使用Laravel 方法.但它对我不起作用.
foreach ($this->options as $option) {
if($options->contains($option->id)) {
dd('test');
}
}
Run Code Online (Sandbox Code Playgroud)
dd($options);
看起来像这样:
Collection {#390
#items: array:1 [
0 => array:3 [
0 => array:7 [
"id" => 10
"slug" => "test"
"name" => "test"
"poll_id" => 4
"created_at" => "2016-11-12 20:42:42"
"updated_at" => "2016-11-12 20:42:42"
"votes" => []
]
1 => array:7 [
"id" => 11
"slug" => "test-1"
"name" => "test"
"poll_id" => 4
"created_at" => "2016-11-12 20:42:42"
"updated_at" => "2016-11-12 20:42:42"
"votes" …
Run Code Online (Sandbox Code Playgroud) 我正在使用laravel并且我已经编写了一些测试文件.但是我怎么能只执行一个文件呢?当我这样做时:phpunit tests/resulttesting/school/deleteSchoolForRealTest
它抛出一个错误:
无法打开文件"tests/resulttesting/school/deleteSchoolForRealTest.php".
当我运行phpunit时,它会运行我的所有测试.我怎么能只执行一个文件夹?我在Mac上.
我正在尝试安装,Laravel valet
但我一直在(当我访问domain.dev时):
It works!
Run Code Online (Sandbox Code Playgroud)
我已经尝试了很多.例如:
remove valet
stop apache (apachectl stop)
composer global require laravel/valet
valet install
valet restart
Run Code Online (Sandbox Code Playgroud)
但那对我不起作用.我也安装Laravel Homestead
在一个流浪盒中.也许这与它有关?我可以访问我的Homestead网站.
我该如何解决这个问题?
我正在尝试添加polyfill
到我的vue.js 2.0/Laravel5.3
应用程序,因为在Internet Explorer 11中我收到一个错误:
vuex requires a Promise polyfill in this browser.
Run Code Online (Sandbox Code Playgroud)
所以我跟着我使用ecm 6 的文档,所以我做了:
npm install --save-dev babel-polyfill
Run Code Online (Sandbox Code Playgroud)
并在我的bootstrap.js顶部添加了这个:
import "babel-polyfill";
Run Code Online (Sandbox Code Playgroud)
但在Internet Explorer中仍然存在相同的错误.我该怎么做或我在这里做错了什么?
我想在我的vue.js应用程序中接收json,如下所示:
new Vue({
el: 'body',
data:{
role: '',
company: '',
list:[],
created: function() {
this.getJson();
},
methods: {
getJson: function(){
$.getJSON('http://domain.dev/data',function(task){
this.list = task;
}.bind(this));
}
}
}
});
Run Code Online (Sandbox Code Playgroud)
但结果是空的?当我在邮递员中测试这个时,url返回json.我在这做错了什么?
编辑:
JSON(testdata):
{"EmployeeId":1,"RoleId":5,"DepartmentId":6,"InternId":1,"FirstName":"Zoe","LastName":"Altenwerth","Bio":"Quidem perferendis.","email":"Kole.Bechtelar@hotmail.com","LinkedIn":"Sterling.Schowalter@example.net","Gender":0,"password":"$2y$10$bbUlDh2060RBRVHSPHoQSu05ykfkw2hGQa8ZO8nmZLFFa3Emy18gK","PlainPassword":"gr^S=Z","remember_token":"D528C0Ba1Xzq3yRV7FdNvDd8SYbrM0gAJdFUcOBq4sNEJdHEOb2xIQ0geVhZ","Address":"0593 Dallin Parkway Apt. 499\nBotsfordborough, MT 12501","Zip":"21503-","City":"East Janiston","ProfilePicture":null,"BirthDate":"2002-10-13 00:00:00","StartDate":"1995-11-09 21:42:22","EndDate":"2011-01-27","Suspended":0,"created_at":"2016-02-29 12:21:42","updated_at":"2016-03-02 11:53:58","deleted_at":null,"role":{"RoleId":5,"RoleName":"Superadministrator","Description":"Mag administrators toevoegen en bewerken","deleted_at":null,"created_at":"-0001-11-30 00:00:00","updated_at":"-0001-11-30 00:00:00"},"department":{"DepartmentId":6,"CompanyId":12,"DepartmentName":"com","Description":"Accusantium quae.","deleted_at":null,"created_at":"2016-02-29 12:21:41","updated_at":"2016-02-29 12:21:41","company":{"CompanyId":12,"CompanyName":"Dare, Bailey and Bednar","Logo":null,"Address":"85762 Tabitha Lights\nWest Jettie, AK 20878-2569","Zip":"29601","City":"Traceside","KvKNumber":"84c70661-9","EcaboNumber":"fdee61e3-a22d-3332-a","deleted_at":null,"created_at":"2016-02-29 12:21:41","updated_at":"2016-02-29 12:21:41"}}}
Run Code Online (Sandbox Code Playgroud) laravel ×5
php ×5
javascript ×2
laravel-5 ×2
vue.js ×2
angular ×1
angular-cli ×1
angular6 ×1
babeljs ×1
collections ×1
css ×1
file ×1
json ×1
jwt ×1
laravel-5.2 ×1
laravel-5.3 ×1
migration ×1
phpunit ×1
polyfills ×1
sass ×1