Category : controller

I have this in my controller, but it keeps comes our below error in my edit.blade ErrorException Undefined variable: category (View: namespace AppHttpControllers; use AppModelsCategory; use IlluminateHttpRequest; class CategoryController extends Controller { /** * Display a listing of the resource. * * @return IlluminateHttpResponse * */ public function __construct() { } public function index() { ..

Read more

My model requires minimum 10 character passwords. However, I want to be able log in my user: [email protected] with a password of just 4 characters. How to achiveve this? This is part of my controller: public function actionLogin() { if (Yii::app()->user->isGuest) { $model = new LoginForm(‘login’); $loginForm = Yii::app()->input->post(‘LoginForm’); $returnUrl = Yii::app()->input->get(‘return’); if (!empty($loginForm)) { ..

Read more

So, it’s my first LiveWire learning Project. Just to the point, I’m making a Livewire Component called User using php artisan make:livewire user and then this is what I got First User.php <?php namespace AppHttpLivewire; use LivewireComponent; class User extends Component { public function render() { return view(‘livewire.user.index’); //i’ve updated this } } And so, ..

Read more

I’m trying to make a function to download pdf files based on pdf id stored in the database. Files are stored in public/CVs folder and I’m getting the following error Attempted to call an undefined method named "getParameter" of class "SymfonyComponentDependencyInjectionArgumentServiceLocator". Here is the code: /** * @Route("/home/download/{id}") */ public function download($id) { try { ..

Read more

How can i pass data to all controllers in Laravel 8.I tried to this. Controller extends BaseController { use AuthorizesRequests, DispatchesJobs, ValidatesRequests; public function __construct() { $defaultLanguage = Language::getDefaultLanguage(); $defaultLanguageId = $defaultLanguage->id; View::share(‘defaultLanguageId’,$defaultLanguageId); } } But that give me Method IlluminateViewView::share does not exist. this error. Sourc..

Read more

I wan´t to convert a .docx file into PDF. If I use The PhpOfficePhpWord Libraries, i lose my styles, so i have tried with OfficeConverter, but i have this error: "Convertion Failure! Contact Server Admin." I have this in my Controller $converter = new OfficeConverter(storage_path(‘./../MyFile.docx’)); $converter->convertTo(storage_path(‘./../MyFile.pdf’)); Also in the header of this php file i ..

Read more