Posts

php - Middleware For actions into Controller, Laravel 5.1 -

i have controller have index method, have multiple levels of users have access method, single admin can view records of database how can add middleware select action corresponding user? have next code <?php namespace set\http\controllers; use illuminate\http\request; use illuminate\support\facades\session; use illuminate\support\facades\redirect; use set\http\requests; use set\http\requests\labrequest; use set\http\controllers\controller; use illuminate\routing\route; use set\lab; use validator; use auth; use db; class laboratoriocontroller extends controller { public function __construct(){ $this->beforefilter('@find', ['only' => ['show','edit','update','destroy']]); } public function find(route $route){ $this->laboratorio = lab::findorfail($route->getparameter('laboratorio')); } /** * display listing of resource. * * @return response */ public function index() { $labs = lab::all(); r...

c++ - Building Qt-4.3.2 from source on Linux machine -

i trying build , compile qt 4.3.2 on linux machine.i have downloaded package http://download.qt.io/archive/qt/4.3/qt-x11-opensource-src-4.3.2.tar.gz.mirrorlist configured options: ./configure -platform linux-g++ -debug-and-release -qt-zlib -qt-libtiff -qt-libmng -qt-libjpeg -openssl -v -opengl -glib after trying compile make , getting following error. ../../../include/qtcore/../../src/corelib/thread/qatomic.h: in instantiation of ‘qatomicpointer<t>::qatomicpointer(t*) [with t = qbytearray]’: ../../corelib/codecs/qsimplecodec.cpp:609:74: required here ../../../include/qtcore/../../src/corelib/thread/qatomic.h:207:7: error: ‘init’ not declared in scope, , no declarations found argument-dependent lookup @ point of instantiation [-fpermissive] ../../../include/qtcore/../../src/corelib/thread/qatomic.h:207:7: note: declarations in dependent base ‘qbasicatomicpointer<qbytearray>’ not found unqualified lookup ../../../include/qtcore/../../src/corelib/thread/qatomic.h...

c# - An object reference is required for the non-static field, method, or property -

ive looked @ duplicate errors havent found solution here method im implementing in business logic public void updatebooking(bookingview model) { using (var booking = new bookingrepository()) { var user = new applicationuser(); booking book = booking.getbyid(model.bookingid); if (book != null) { book.bookingid = model.bookingid; book.bookingdate = model.bookingdate; book.bookingtime = model.bookingtime; book.location = model.location; //book.status = defaultstatus(); //book.treatmentname = book.treatmentname; //book.addinfo = model.addinfo; booking.update(book); } } } but error on booking controller method [httppost] [validateantiforgerytoken] public actionresult postponebooking([bind(include = "location,bookingdate,bookingtime")]book...

java - Tomcat Virtual host Requests for different wars -

what best practices handling multiple host requests same context path :eg: "my-services" different environment(test, dev, prod) tomcat 7 server want webapplication different flavors of war, test.war, dev.war deployed on same tomcat instance. please let me know caveats in doing this? war file restful web service consumed different apache httpd server running on same machine of tomcat server. i followed tomcat documentation following links explain in more elaborative manner http://www.ex-parrot.com/pete/tomcat-vhost.html?bcsi-ac-0f50f852aecff21e=24aedc5100000002vjkkrulw4bxxzrg4kowom6tbvxodbaaaagaaactxdwasaqaaaaaaacmxaga=

javascript - Having trouble converting /Date(####)/ to MM/dd/yyyy local with MomentJS -

using external api that's sending me dates such as: /date(1439596800)/ the above date is: august 30, 2015 using momentjs this: moment("/date(1439596800)/").format("mm/dd/yyyy"); gets me this: 01/17/1970 :( i'm aware i'm supposed multiply * 1000 hoping there specific momentjs method. thank help. it's rather simple. your api gives unix timestamp - default, moment(arg) assumes arg passed milliseconds since 1st january 1970. for converting it, must first remove /date( , )\ . i'd use regex strips non-digit characters: mystring = mystring.replace(/\d/g,''); this leave numbers. now, can run moment.unix(mystring).format("mm/dd/yyyy"); moment.js reference unix timestamps

php - Paypal payment destroys Session on "Return" -

this question has been asked before. but, still unable find solution. i have integrated paypal payment website. created , installed "payment button" (the html code), , works perfectly. the problem, however, : after being re-directed paypal make payment, user's session on website destroyed. meaning : after payment successful (or canceled user, whichever).......the "return url" not work, because user has been logged out. i did contact paypal, of course; and, expected, next useless (exactly many people here have attested to). as said earlier, question has been asked before, here : anybody ever used paypal website payments standard session variables? the answer proposed "woppi" in thread seemed ok. but, when tried it, did not work. (of course, thread 3 years old). i don't know else do. i should point out following, (this makes no difference, want clear possible) : (a) on website's "log-out page", have set session...

javascript - Passing values from directive to controller -

below html template: <div ng-app="dr" ng-controller="testctrl"> <test color1="color1" data-method="ctrlfn(msg)"></test> </div> below code: var app = angular.module('dr', []); app.controller("testctrl", function($scope) { $scope.ctrlfn = function(arg) { alert(arg); } }); app.directive('test', function() { return { restrict: 'e', scope: { fromdirectivefn: '&method' }, link: function(scope, elm, attrs) { //way 1 scope.hello = "some message"; scope.fromdirectivefn(scope.hello); } } }); <div ng-app="dr" ng-controller="testctrl"> <test color1="color1" data-method="ctrlfn(msg)"></test> </div> why getting " undefined " instead of " some message ...