我将通过阅读官方网站上的文档回到Laravel编程.现在我意识到有一个5.0版本,我正在尝试它,但是我注意到了一个叫做"用户注册和身份验证的脚手架"的东西,我根本不理解它.
也许是因为我的主要语言是西班牙语,在这种情况下,这个词对我来说没有意义,但我真的很困惑.
在网站上,该段落说:
Laravel附带脚手架进行用户注册和认证.如果您想删除此脚手架,请使用新的Artisan命令:
Run Code Online (Sandbox Code Playgroud)php artisan fresh
所以我想知道它究竟意味着什么,它代表什么.
我有一个角度2应用程序,我需要在每个页面上进行身份验证.所以我已经实现了一个自定义的RouterOutlet来确认我在每次更改页面时都已登录.
@Directive({
selector: 'auth-outlet'
})
export class AuthOutlet extends RouterOutlet {
publicRoutes: any;
private parentRouter: Router;
private authService: AuthService;
constructor(_elementRef: ElementRef,
_loader: DynamicComponentLoader,
_parentRouter: Router,
@Attribute('name') nameAttr: string,
_authService: AuthService) {
super(_elementRef, _loader, _parentRouter, nameAttr);
this.parentRouter = _parentRouter;
this.authService = _authService;
this.publicRoutes = {
'Login': true
};
}
activate(oldInstruction: ComponentInstruction) {
var url = this.parentRouter.lastNavigationAttempt;
console.log('attemping to nav');
if (!this.publicRoutes[url] && !this.authService.loggedIn){
var newInstruction = new ComponentInstruction('Login', [], new RouteData(), Login, false, 1);
return super.activate(newInstruction);
} else {
return super.activate(oldInstruction); …
Run Code Online (Sandbox Code Playgroud) 我正在使用 angular5 开发一个应用程序,通过 ng-cli 使用服务工作者,但我意识到在第一次加载应用程序外壳后,它不会刷新。使用ng build
?构建应用程序后,如何将新文件版本推送到我的应用程序。我可以直接手动重写 sw.js,但是因为它是通过 cli 生成的,所以我不喜欢影响任何我不知道是做什么的。
我整天都在寻找这个答案,但由于服务工作者是 1.6 版 ng-cli 的新成员,我没有找到任何答案。
我什至在 ng-cli 1.6 之前找到了一个与 angular 4 和非官方 Service Workers 实现类似的线程,但我不相信这种方法,因为它不是官方的,所以我想知道你们是否可以帮我找到一种控制外壳安装方式和寻找新版本的方法。
谢谢
service-worker progressive-web-apps angular-cli angular5 angular-service-worker
我正在开发一个允许我的用户上传文件的应用程序,并且我已经使用文件系统功能使其与"本地"磁盘一起工作,但现在我想迁移并使用Google Google云端存储.
找到一些有用的信息非常困难.在文档中有一个与dropbox一起工作的"示例",但它并不完整.它没有显示如何配置驱动程序和磁盘,因此对我来说还不够清楚.
我想知道该怎么做,因为我现在不知道.
我刚刚使用了这个教程http://www.codetutorial.io/laravel-5-file-upload-storage-download/,它正在为本地工作,所以我真的需要迁移到谷歌云存储,只有那个.我正在使用openshift,我觉得很舒服.
你能不能请我知道我应该配置哪些文件系统可以根据需要使用?
谢谢
php google-cloud-storage laravel-5 flysystem laravel-filesystem
我有一个包含两列、品牌和商店的数据库。每个品牌都可以欠几家商店,我想使用 Laravel 通过 Fakers 为我的数据库做种子。
所以在模型中设置迁移和关系之后
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Brand extends Model
{
/**
* Get the shops for the brand.
*/
public function shops()
{
return $this->hasMany('App\Shop','sh_brand_id');
}
}
Run Code Online (Sandbox Code Playgroud)
和:
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Shop extends Model
{
public function user() {
return $this->belongsTo('App\Brand','sh_brand_id');
}
}
Run Code Online (Sandbox Code Playgroud)
我想使用工厂来为数据库做种。
<?php
use Faker\Generator as Faker;
$factory->define(App\Shop::class, function (Faker $faker) {
return [
'name' => $faker->company,
'address' => $faker->address,
];
});
Run Code Online (Sandbox Code Playgroud)
和
use Faker\Generator as Faker;
$factory->define(App\Brand::class, function …
Run Code Online (Sandbox Code Playgroud) php ×3
laravel ×2
angular ×1
angular-cli ×1
angular5 ×1
eloquent ×1
faker ×1
flysystem ×1
laravel-5 ×1
scaffolding ×1