Category : store

I am trying to store data for my form but i keep getting AppHttpControllersKeyresultController::store(): Argument #2 ($objective) must be of type AppModelsObjective, string given, called in /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Controller.php on line 54 here is my store function inside KeyresultController.php public function store(Request $request, Objective $objective) { // $objective = Objective::where(‘id’,$objective->id)->first(); $request->validate([ ‘keyresult_name’ => ‘required’, ]); keyresult::create([ ‘keyresult_name’ ..

Read more

i have a pivot table that i want to record some data along with user on form submit. but im getting an error illegal offset type. $user has a value. same value if i add manually it works. my controller public function store(User $user) { //dd(Request()->all()); $data = request()->validate([ ‘title’ => ‘required’, ‘link’ => ‘required’, ..

Read more

I have this code in laravel to store an image but why does the image name change when I checked it on the folder ?! Please help me I’m really frustrated ! public function postStore(Request $req){//Bikin toko baru $req->image->store(‘images’,’public’); $req->validate([ ‘name’=>[‘string’,’min:5′], ‘address’=>[‘string’,’min:10′], ‘description’=>[‘string’,’min:20′] // ‘image’=>’mimes:jpg,png,jpeg’ ]); Sourc..

Read more

i’m trying to pass data(title,description and resized image) to my database this is the store function, for now it saves my images in that path but it doesn’t save them in the database the store function can work if i remove the resize image. public function store(Request $request) { $request->validate([ ‘title’ => ‘required’, ‘image’ => ..

Read more

Hi I’m saving information from blade. The form goes to store function. After saving data I have to send push info using GCM. But this function can not return to view. How can solve this? public function store(Request $request) { $request->validate([ ‘title_uz’ => ‘required’, ‘desc_uz’ => ‘required’, ‘url_uz’ => ‘required’, ‘company_id’ => ‘required’, ]); News::create($request->all()); ..

Read more

So I want to upload a picture but it only store its description correctly. The file is stored as "noimage.jpg" which means the filename isn’t read. I’m using modal btw. My database is named galleries and the migration contains these: $table->id(); $table->timestamps(); $table->string(‘upload’); $table->longtext(‘description’)->nullable(); CONTROLLER: public function store(Request $request) { $galleries=new Gallery; // Handle File ..

Read more

I have an array of objects named Employees and am trying to get the ones who are department_id=3 and I don’t want to go back to laravel and make another request so is there a way to do so with vuex? “id”: 25, “name”: “name”, “email”: “[email protected]”, “last_name”: “lastname”, “phone”: “98745632”, “gender”: “Male”, “nationality”: “Tunisian”, ..

Read more