#### Category : crud

Each user has a role. When creating a new user form the admin panel, I am not able to create a user with any role id other than 2 i.e. customer. This is my controller function: public function store(UsersRequest $request) { // if(trim($request->password) == ”){ $input =$request->except(‘password’); } else{ $input =$request->all(); $input[‘password’] = .. Read more I am trying to make my own api with Laravel 8. But I have run into some roadblocks. As you can see from this image (is a part of my ERD). I have the following relationships: a user has many pets, but a pet belongs to 1 user a user can input many weights, but .. Read more I am trying to preform a crud with foreign key(S). But I have run into some roadblocks. As you can see from this image (is a part of my ERD). I have the following relationships: a user has many pets, but a pet belongs to 1 user a user can input many weights, but a .. Read more kindly avoid giving me negative reviews Thanks in Laravel Backpack admin, when we click on Date Range filters , it’s Filtering our table data, that is working fine, but I want Graph also get changed when we change ajax filters. as per I know, ajax Date Range filter code in CrudConTroller :$this->crud->addFilter([ ‘type’ => ..

I’m trying to refactor my code to be more reusable. I created a trait CrudControllerTrait to implement the index,show,store,update,destroy methods. But I found 2 problems: BrandController.php public function store(BrandNewRequest $request) {$requestData = $request->validated(); return new BrandResource($this->brands->store($requestData)); } ProductController.php public function store(ProductNewRequest$request) { $requestData =$request->validated(); return new ProductResource($this->products->store($requestData)); } The trait method would ..

I ask for solutions or suggestions regarding my program. here I try to update the ticket table. however, when I try to debug with json_encode it is empty and there is no change in the update RequestActionController public function update(Request $request) { DB::table(‘ticket’)->where(‘id’,$request->id)->update([ ‘namacust’ => $request->namacust, ‘daerah’ =>$request->daerah, ‘alamat’ => $request->alamat, ‘notlp’ =>$request->notlp, ..

So I’m doing this crud thing using modal and I think I was able to do it except that the datas from the table were not displayed at the modal’s textboxes. I am able to update my table, it’s just that I want the selected row’s data to be displayed in the modal. here’s my ..

im making an edit section on my laravel crud project. that when i press edit, it will redirect to the edit.blade.php which will call the slug instead their id. i have worked on it and it shows the error that Too few arguments to function AppHttpControllersProductController::edit(), 1 passed and exactly 2 expected my Route Route::get(‘edit/{slug}’, ..

I had a problem with Crud Form in this discussion. I will send 4 photos of the code and execution. :: Create.blade.php codes http://s15.picofile.com/file/8409172650/1.JPG :: Codes :: PostsConteroller http://s14.picofile.com/file/8409172676/2.JPG :: Codes :: Web.php http://s14.picofile.com/file/8409172692/3.JPG :: Execute page code cms.test / posts / create http://s15.picofile.com/file/8409172718/4.JPG Please send the answer a bit faster than normal. Be clear ..

I am trying to retrieve data from the database in Laravel 8. But I am getting 500 server errors and 404 errors. Here, I have included my codes: controller: <?php namespace AppHttpControllers; use IlluminateHttpRequest; use DB; use AppHttpRequests; use AppHttpControllersController; class productController extends Controller { public function index() { $users = DB::select(‘select * from products’); .. Read more I’ve got 2 tables with one to many relationship. portfolios id category_id status image portfolios_lang id portfolio_id title text lang I used backpack crud for portfolios_lang and I was able to create records. I added my logic to store() in my PortfolioLangCrudController. But when I want to update a record I can’t make it so .. Read more I have in my app the option to tag users to be deleted, and in 15 days they will be deleted. They can also be untagged. Problem I’m having is I cannot find a way to change the text of the button according to the user status. I would like that it shows "Tag for .. Read more I am trying to put a search engine in my laravel page, but I have a lot of difficulties to be able to achieve it, clearly I cannot find the way to work correctly. the version of laravel I use is 5.8. I leave the code to see if someone can help me! Form in .. Read more i have been trying to show an image that i already stored on a folder and stored the path in the database, i need to show it on the edit page that i created using the infyom CRUD generator. Been trying like this and even adding the img tag but it just displays the broken .. Read more I use Laravel 8 inertia and vue I want to update a post and I use this component in a main vue <template> <div class="container p-3 bg-green-600 flex flex-col"> <div class="mb-8 text-2xl">{{ current_post.title }}</div> <div v-if="!edit" id="mode-display"> <div v-html="compiledMarkdown" class="text-gray-700"></div> </div> <div v-else id="mode-edit"> <form class="flex flex-col" @submit.prevent="updatePost"> <input type="hidden" name="id" id="id" v-model="current_post.id"> <button type="submit">Mettre .. Read more HOW CAN I DO AN IMAGE CRUD FOR MY RECENT LARAVEL PROJECT? When I create a product, i want to browse my file to store an image to my database in views. When I update a product, i want to browse button with a preview image and the recent image. Note: My Laravel Version is .. Read more When I run the known tinder CRUD Commands in Laravel 8, they aren’t working What I ran was the Create and Find commands$user = new AppUser; AppUser::all(); But they aren’t working, I knew that in Laravel 8, the Model file is in this path AppModels ‘File’, and I tried to modify the creating code ..

i’m working on an laravel vuejs spa. I try to update a post from the admin. I send the form datas on creating a new FromData who are sending with and axios request. But the controller send me the error: message: "The given data was invalid." errors: {name: ["The name field is required."], description: ["The ..

I’m create CRUD app. But when i coding in method store . I have problem , I’m try to create variable $contact = new Contact(). It’s message :Undefined type ‘AppContact’ This ContactController.php ues AppContact; …. public function store(Request$request) { $request->validate([ ‘first_name’=>’required’, ‘last_name’=>’required’, ’email’=>’required’ ]);$contact = new Contact([ ‘first_name’ => $request->get(‘first_name’), ‘last_name’ =>$request->get(‘last_name’), ..
I’m creating a CRUD app. But when I code in method store I have a problem: I’m trying to create a variable $contact = new Contact(). It’s message: Undefined type ‘AppContact’. This ContactController.php use AppContact; …. public function store(Request$request) { $request->validate([ ‘first_name’=>’required’, ‘last_name’=>’required’, ’email’=>’required’ ]);$contact = new Contact([ ‘first_name’ => \$request->get(‘first_name’), ‘last_name’ => ..