<?php

namespace app\utilities;

trait RedirectTrait
{
	protected function redirectTo($location)
	{
		if(!empty($location)) {
			header("Location: {$location}");
		}
	}
	
}
Create a new trait containing redirectTo method
Create a new trait containing redirectTo method
