Saturday, March 19, 2016

Undefined Variable: Errors in Laravel 5.2 Application

Recently in one of my Laravel 5.2 project we were using Laravel model validations on server side, where we faced an issue that on failed validation it goes back to previous view but we did not get any errors as it was giving error undefined variable $errors.

This is a breaking problem with the 5.2 upgrade. What's happening is the middleware which is responsible for making that errors variable available to all your views is not being utilized because it was moved from the global middleware to the web middleware group. So to fix this issue you have to do following.

Wrap all your web routes with a route group and apply the web middleware to them

Route::group(['middleware' => 'web'], function() {
    // all routes.
});

That's it and now it should work.

Laravel App Not Working in Iframe in Internent Explorer

Recently in one of my project we faced strange issue. We have one application running from one domain. This application has an iFrame which is loading laravel app from other domain. This laravel app has certain ajax requests. The issue was this laravel app and ajax requests were working fine in Chrome and other webkit browser however it was not working in Internet Explorer.

After few ours of struggle we found a solution. Actually it was an issue of cookies being blocked by Internet Explorer. We all know that laravel app creates certain cookies on the front end. This was blocked by Internet Explorer hence Ajax requests were not working as it was unable to find cookies. First of let me explain what exactly was the issue and then we will look for solution.

Internet Explorer gives lower level of trust to IFRAME pages (IE calls this "third-party" content). If the page inside the IFRAME doesn't have a Privacy Policy, its cookies are blocked (which is indicated by the eye icon in status bar, when you click on it, it shows you a list of blocked URLs).

In this case, when cookies are blocked, session identifier is not sent, and the target script throws a 'session not found' error.

So to solve this problem, it is possible to make the page inside the IFRAME more trusted: if the inner page sends a P3P header with a privacy policy that is acceptable to IE, the cookies will be accepted. So here is how to do this in Laravel app. Add this header in your laravel controller.

header('P3P: CP="This site does not have a p3p policy."');

And that's it it will solve the problem.

You can get more information about P3P policy from below link.

https://www.w3.org/P3P/details.html


Hope this helps you.

Sunday, February 21, 2016

Expense Management System for Small and Medium Businesses in India

Hello,

This blog is about an Expense Management System developed by us for small and medium business in India.

Automate the complete expense chain from expense report creation through manager approvals to payroll approvals to reimbursements. Spend to reimbursement cycles are faster, process visibility is high, financial control and management control is high and employees are happier.

Our Expense Management System is

Connected

It's web based system so it can be used from anywhere and anytime and from any device which is connected to internet.

Transparent

Integrated company expense policies and custom approval process improve compliance and visibility.

Foolproof

Level based expense eligibility. Set up max limits for each expenses. Employees can take pictures of receipts and create and submit expense reports. Managers can quickly review and approve.

Customized Expenses and Transports

As per company policy you can create expenses and transports. Transports also includes public and private transports. For private transports you can specify rate per KMs to easily calculate cost of traveling.

Reports

Customized reports of expenses, which can be company based, location based and employee based. Monthly and Annual reports. 

Automated Reminders

Our system sends automated reminders to managers to approve the claims of employees and escalate to higher management if there is no action taken within specified time period.

How Does It Work

Step 1

First of all we will setup a system with your company's name. For example

http://yourcompanyname.novustouch.com.

We will create two logins for you. 

1) HR manager Login
2) Payroll Manager Login

Step 2

You can login to system and create expenses and transports that you will allow your employee to submit,





As you can see in above screenshots, you can create expense and set eligibility as per various levels and set max limit for each one. You can also categorize it as per city level. You can also add custom fields if you want to gather more information for particular expense from employee.


Step 3

Submit a claim. All your employees will get login to systems so they can submit a claims. Claim submissions are very simple. Just enter dates for the claims and add expense and it's details and submit it to manager.




Step 4

Now manager can login to systems and can see pending claims and approve or decline it.



After manager approves it, it will go for HR approval and then it will go for Payroll approval. Once all the claims are approved a customized report is generated and can be downloaded and be used for payroll processing.

So with our Expense Management System you can improve productivity, compliance and control over business expenses. Easily track, analyze and report on spending.

If you want this system for your organization please contact us. Following are our contact details.

Name : Vibhay Vaidya 
Mobile : +919769955555
Email : vibhay@novustouch.com

Name : Rinkal Shah
Mobile : +919898171728
Email: rinkal@novustouch.com