我正在尝试运行检查以查看当前用户是否与Cartalyst的Sentinel/Sentry包具有特定角色.
我发现Sentinel::inRole('admin')但似乎无法让它发挥作用.我想要这样的东西:
if(Sentinel::getUser()->hasRole('admin'){ // do some stuff }
我搜索并搜索了这个,但找不到合适的例子.我应该更多地考虑权限或什么?
希望有人可以指出我正确的方向.
干杯
我撞到了另一面墙!现在已经好几个小时了.
我有一个从购物车系统的JSON文件中提取的产品列表.
当客户将产品添加到购物车时,我想要刷新JSON Feed,因为我已将其设置为根据客户在购物车中的内容调整库存水平,因此他们无法添加太多产品,而商店不会有.
'加入购物车'运作良好.但我无法弄清楚如何"推送"更新的Feed来更新DOM元素.
这是我到目前为止:
$scope.reloadData = function(detailSection) {
// Find the URL title of the current click product
var prod_detail_url = $scope.products[detailSection].url_title;
var prod_category_id = $scope.products[detailSection].discount_category;
var prod_sku = $scope.products[detailSection].title;
// Set the defaults of the info to load in
var detailurl = '/order/series_detail/' + prod_detail_url + '/' + prod_category_id + '/' + prod_sku;
$scope.productDetail = [];
// Process the details of the product
$scope.reloadedDetails = function (data, status) {
$scope.productDetail = data;
$scope.productDetail.push(data);
$('.detailloader').hide();
}
// Fetch …Run Code Online (Sandbox Code Playgroud)