Whenever I try to only save profile changes for the profile description and url in the edit form, I get an error because I didn’t choose an image file also. I would like to be able to update a profile with current image when an image file is not chosen in the edit form. The error I keep getting is:
Tag: model-view-controller
create counter for blog categories in laravel
I´m traying to create one counter for my blog´s categories. This should appear to the right name side of my category . i´m using my model with variable appends, that after i will use in my blade for show my result in one span. But i don´t know very well how i can use count in my Model. I´m doing
My php rooter is routing my css/jpg… files
I got a homemade php rooter with an htaccess rewriting rule but my public files are always getting catched by the rooter after I leave my landing page, blocking thoses sources on my other pages. index….
How to check if related table doesn’t have record
matches table has releationship with scores table. I need to get all matches without record in scores table. tryied smth, but didint worked: Answer If you use relationship, you can use doesntHave() , but if you use query builder as you write in your question, you may use these codes, I saw that your where condition need some adjustment to
Why Laravel 7 Generates Views in /storage/framework/views/, and how to stop creating them?
Laravel keeps generating views simultaneously with the views I am editing. Answer You can do that but for that you have to edit Laravel’s core files, it is not advisable. You can delete the views generated in storage folder by using following artisan command.
Laravel find and replace content on the basis of a expression in content coming from Db
I have a blog content in which admin can add pattern like this => %make123%. when that content is to be displayed i have to replace that %make123% with the vehicle id of 123 but now how to get that 123 from my content. and then make another query to search the vehicle with that id. this is my controller
Too few arguments to function php
my controller { } ?> my model { } app.php it shows this error Fatal error: Uncaught ArgumentCountError: Too few arguments to function product::index(), 0 passed in C:xampphtdocshermesmvccoreapp.php on line 40 and exactly 1 expected in C:xampphtdocshermesmvccontrollsproduct.php:14 Stack trace: #0 C:xampphtdocshermesmvccoreapp.php(40): product->index() #1 C:xampphtdocshermesmvcindex.php(9): App->__construct() #2 {main} thrown in C:xampphtdocshermesmvccontrollsproduct.php on line 14 Answer Replace in your app.php $params=array_values($url); by
updating blade view everytime theres an update in the the database table
I have a stat bar on my blade, which for example says ‘Calls Today : 0’ etc, I need for the the stats to update each time theres an update in the sql database for calls today. so for example if calls Today goes up to 5 in the database, the blade views Calls Today must also go up to
How view file get the variable from controller?
I’m a student and new to PHP. After searching a lot i still don’t understand how the view file got the variable from controller. I got the function view() from Controller.php class. And i got a HomeController.php Extends the Controller This is inn my calc.php view file. As you can see that the calc.php doesn’t require any file from Controller.php
how to return a button using controller response to html
in my laravel application i have defined some rules which is returned by controller here it is code i wnat in return it should also return a button <a href=”{{ route(‘edit.order’ , $order->id) }}” class=”btn btn-sm btn-primary”><i class=”fa fa-edit”></i>Edit Order</a> how i can return that button using controoller? Answer The simple solution would be to save the button HTML and