在Laravel 5.4中,当我尝试将用户模型保存到数据库时,不保存值.我也设置了可填充属性.
它在Laravel 5.3中工作.将应用程序升级到Laravel 5.4之后,就会出现此问题.
以下是用户模型.
class User extends BaseModel implements AuthenticatableContract, CanResetPasswordContract, JWTSubject
{
use SoftDeletes,
UserAccess,
UserAttribute,
UserRelationship,
Authenticatable,
CanResetPassword,
Notifiable;
/**
* Database Table
*
* @var string
*/
protected $table = "users";
/**
* The attributes that are not mass assignable.
*
* @var array
*/
protected $guarded = ['id'];
/**
* Fillable Form Fields
*
* @var array
*/
protected $fillable = [
'name',
'first_name',
'last_name',
'email',
'password',
'status',
'confirmed',
'api_user',
'confirmation_code',
'account_id',
'role_id',
'cw_contact_id', …
Run Code Online (Sandbox Code Playgroud) 我正在使用Facebook PHP SDK来调用相关的API来发布和获取数据.目前我正在数据库中保存用户访问令牌,但它会在60天后过期.如何刷新用户访问令牌?
1.我什么时候需要刷新访问令牌?它到期后还是之前?
2.刷新访问令牌的最佳方法是什么?
3.我的用户是否需要再次登录才能刷新访问令牌?
这是我用来扩展访问令牌的功能.但到期时间保持不变.
public function getExtendedAccessToken($access_token)
{
$token_url="https://graph.facebook.com/oauth/access_token";
$params=array('client_id'=>self :: appId,'client_secret'=>self :: appSecretId,'grant_type'=>'fb_exchange_token','fb_exchange_token'=>$access_token);
$response = $this->curl($token_url,$params);
$response = explode ('=',$response);
$response = explode ('&',$response[1]);
$response = $response[0];
return $response;
}
Run Code Online (Sandbox Code Playgroud) php facebook facebook-graph-api facebook-php-sdk facebook-access-token
我在php中的应用程序,我将从这个其他API获取我的网络的所有连接.
http://api.linkedin.com/v1/people/~/connections?modified=new
但它给出了错误的会员ID.我在LinkedIn休息控制台(https://developer.linkedin.com/rest-console)中检查了相同的API结果,但它提供了不同的输出.
控制台输出:
<person>
<id>nzdqEWJjKM</id>
<first-name>Sagar</first-name>
<last-name>Modi</last-name>
<headline>Sr. HR Officer - Generalist at MAS Financial Services Ltd.</headline>
<picture-url>http://m3.licdn.com/mpr/mprx/0_3vxs_YPyEsnVrHXzT-Jd_pvlox-zraqzitwL_pt_zJ6LfEivSP7nDy6SXttoPdzJhngkuU2v-HG2</picture-url>
<api-standard-profile-request>
<url>http://api.linkedin.com/v1/people/nzdqEWJjKM</url>
<headers total="1">
<http-header>
<name>x-li-auth-token</name>
<value>name:PSbh</value>
</http-header>
</headers>
</api-standard-profile-request>
<site-standard-profile-request>
<url>http://www.linkedin.com/profile/view?id=54732271&authType=name&authToken=PSbh&trk=api*a108281*s116823*</url>
</site-standard-profile-request>
<location>
<name>Ahmedabad Area, India</name>
<country>
<code>in</code>
</country>
</location>
<industry>Human Resources</industry>
</person>
Run Code Online (Sandbox Code Playgroud)
使用我的应用程序中的rest API输出:
<person>
<id>7dmJjxBx_k</id>
<first-name>Sagar</first-name>
<last-name>Modi</last-name>
<headline>Sr. HR Officer - Generalist at MAS Financial Services Ltd.</headline>
<picture-url>http://m3.licdn.com/mpr/mprx/0_3vxs_YPyEsnVrHXzT-Jd_pvlox-zraqzitwL_pt_zJ6LfEivSP7nDy6SXttoPdzJhngkuU2v-HG2</picture-url>
<api-standard-profile-request>
<url>http://api.linkedin.com/v1/people/7dmJjxBx_k</url>
<headers total="1">
<http-header>
<name>x-li-auth-token</name>
<value>name:PSbh</value>
</http-header>
</headers>
</api-standard-profile-request>
<site-standard-profile-request>
<url>http://www.linkedin.com/profile/view?id=54732271&authType=name&authToken=PSbh&trk=api*a184885*s193024*</url>
</site-standard-profile-request>
<location>
<name>Ahmedabad Area, India</name>
<country> …
Run Code Online (Sandbox Code Playgroud) 我正在使用Zend-Framework,下面是我的htaccess的代码.
rewriteEngine On
RewriteCond %{HTTPS} =off
RewriteRule ^(.*)$ https://www.mysite.co/$1 [R=301,L]
RewriteCond %{http_host} ^mysite.co [NC]
RewriteRule ^(.*)$ https://www.mysite.co/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
Run Code Online (Sandbox Code Playgroud)
现在我想在所有其他页面上强制使用mysite.co/news/*和https上的http.那么我该如何申请规则呢?
我试图找到当前路线的完整路径 Laravel 5.x
对于这种情况,我使用以下代码创建了一个方法,但我无法想象它Laravel
本身不提供这样的东西:
$current = Route::getFacadeRoot()->current();
$uri = $current->uri();
foreach ($current->parameters() as $key => $param) {
$uri = str_replace('{' . $key . '}', $param, $uri);
}
return url($uri);
Run Code Online (Sandbox Code Playgroud)
有什么开箱即用的东西Laravel
我找不到吗?
当任何侧栏打开时,我不希望用户滚动.它们应该在关闭时滚动.
我使用下面的代码,但它不适用于Android移动设备
$(document).bind('panelopen', function (e, data) {
$('body').css("overflow", "hidden");
});
$(document).bind('panelclose', function (e, data) {
$('body').css("overflow", "auto");
});
Run Code Online (Sandbox Code Playgroud)