Sync multiple IDs in laravel
I'm doing a dental function, I'm looking to sync data in a many-to-many relationship. I have the following: tooth - id - name cost - id - name cost_tooth - id - tooth_id - cost_id - row_number This is the…
I'm doing a dental function, I'm looking to sync data in a many-to-many relationship. I have the following: tooth - id - name cost - id - name cost_tooth - id - tooth_id - cost_id - row_number This is the…
$maincategory = Category::all(['id', 'category']); $maintable = Category::orderBy('id', 'DESC')->get(); $subcategory = Subcategory::all(['id', 'subcategory']); $subtable = Subcategory::orderBy('id', 'DESC')->get(); return view('admin.news.create', compact('maincategory', $maincategory, 'maintable','subcategory',$subcategory,'subtable')); am getting error on this return view('admin.news.create', compact('maincategory', $maincategory, 'maintable','subcategory',$subcategory,'subtable')); how to solve it?
I have a form that using ajax for update data client. In that form there is an input file. Everything is going fine except for updating the file. File is sent, it changed on storage too, but it gives error…
sI have a livewire form with an address field that has google places autocomplete enabled on it. Every time I select an address from the autocomplete list and move to a new input in the form the address input gets…
I'm trying to redirect a subdomain user to his profile. For example: If user requested user.example.com he gets redirected to example.com/user I searched a lot, and most answers were old and didn't work. Things I have done: Created A record…
I was using following Route declaration to pass language action to the routes. Route::get('/de', ['uses' => 'PageController@showHomepage', 'language' => 'de']); And in controller, I was able to get this value like this: $action = $request->route()->getAction(); // $action['language'] gives the given…
I am using laravel framework to develop api’s ,it’s an existing application .there is a requirement if more than 5users registered from 6th user onwards i have to restrict them to use application until they approved by manager or they…
I want to change the default directory for creating migration i.e. If I do php artisan make:migration create_users_table, it should create users table in /database/migrations/child_database. I do not want to use --path every time I create a migration for child_database.…
I have multiple databases setup. I want to change the default folder for migration run i.e. I want that if I run php artisan migrate. It should run the new migrations in /database/migrations/master_database instead of /database/migrations as I have migrations…
Route: Route::get('/posts/{post}', [PostController::class, 'show']); Controller: public function show(Post $post){ $postData = $post->load(['author' => function($query){ $query->select('post_id', 'name'); }]) ->get(['title', 'desc', 'created_date']) ->toArray(); } This returns all the posts in the database, While I only want to get the selected post passed…