Category : backend

I have an issue with my project. I am passing the data through reactjs in the front end, but the value is not getting in the backend. Can anyone say what is the problem. $cert = new certificate; $val = Validator::make($req->all(), $cert->createRules); if ($val->fails()) { return response()->json($val->errors(), 422); } $cert->prize = $req->prize; $cert->name = $req->name; ..

Read more

I have a data structure like you can see in the picture above. I want some fields in the root collections, but I don’t know how can I can get that. public function index (Request $request) { $draw = $request->get(‘draw’); $start = $request->get(‘start’); $length = $request->get(‘length’); $order = Order::with(‘user’); $total_order = $order->count(); $orders = Order::with(‘user’)->offset($start)->limit($length)->get(); ..

Read more

I’m trying to make a query where returns me the results, based on a request word, but I have to filter with the relationship columns as well. Example: Payment::byUnity($unityId) ->with([‘contract:id,nome,sigla’]) ->latest(‘id’) ->where(‘id’, ‘LIKE’, ‘%’ . $request->input(‘search’) . ‘%’) ->orWhere(‘name’, ‘LIKE’, ‘%’ . $request->input(‘search’) . ‘%’) ->orWhere(‘contract.name’, ‘LIKE’, ‘%’ . $request->input(‘search’) . ‘%’) ->orWhere(‘contract.description’, ‘LIKE’, ‘%’ ..

Read more

In Laravel documentation this middleware checks if the requests have a token with the name ‘my-secret-token’: public function handle($request, Closure $next) { if ($request->input(‘token’) !== ‘my-secret-token’) { return redirect(‘home’); } return $next($request); } What is this token in the HTTP requests? I looked in the HTTP RFC and tokens are mentioned but for a different ..

Read more

**i have this ** public function definition() { return [ ‘feature’ => $this->faker->randomElement([‘A/C: Front’, ‘A/C: Rear’, ‘Backup Camera’, ‘Cruise Control’, ‘A/C: Front’, ‘A/C: Rear’, ‘Backup Camera’, ‘Cruise Control’, ‘Power Steering’, ‘Hands-Free’, ‘Heated Seats’, ‘Keyless Entry’, ‘Sunroof’, ‘Airbag: Driver’, ‘Airbag: Passenger’, ‘Fog Lights’, ‘Third Row Seats’, ‘Navigation’]), ]; } calling it like this <div class="row mt-3 ..

Read more

In this section, I want to use the Persian calendar, This form is for a component. What should I change? What should I write to show me this component of the Persian calendar? <div class="form-group "> <label for="date">date</label> <input id="date" name="date" class="form-control datepicker" type="text" value="{{ post.date }}"/> </div> enter image description here Sourc..

Read more

**@foreach($posts as $post)** <div class="card"> <img class="card-img-top" src="…" alt="Card image cap"> <div class="card-body"> <h5 class="card-title">**{{$post->title}}**</h5> <p class="card-text">**{{$post->description}}**</p> <p class="card-text">**{{$post->price}}**</p> </div> </div> **@endforeach** i want to create 4 inline cards to display all post. (4 cards on each line) i tried to put the past code in <div class="card-group"> **here** </div> but res result is many ..

Read more

I am using google drive as the photo storage of the application after uploading, but I have trouble trying to get the image path after uploading. How can I get the link? This is my code upload $name = $request->file(‘thumbnail’)->getClientOriginalName(); $image= $request->file(‘thumbnail’)->storeAs(‘/’, $name, ‘google’); If i use Storage::disk(‘google’)->allFiles() . I get the following array [ ..

Read more

So I have the following code in my blade file but I keep getting a certain error when it tries to read the variables from the backend. {!! (FALSE === $planTier[‘element’][‘badge’] ? ” : "<div class=’pricing__badge-bg’></div> <div class=’pricing__badge-text’> <b> <span class = ‘content’> {!! $content[‘text’][‘UB5JeV’][‘displayText’] !!} </span> </b> </div>") !!} I keep seeing the following ..

Read more

home.php //controller <?php namespace AppHttpControllers; use IlluminateHttpRequest; class home extends Controller { public function index($home) { return view(‘home’,[‘home’=>$home]); } } web.php Route::get(‘home/{home}’,[home::class,’index’]); home.blade.php {{home}} ErrorException Use of undefined constant home – assumed ‘home’ (this will throw an Error in a future version of PHP) (View: C:UsersRASHEED1612Eprojectresourcesviewshome.blade.php) Sourc..

Read more

I’m working on this project were I’m using Laravel 8 as my backend frame work and I have to make a self Join, I have tried out this code but it did not work -the first join is the one I tried but failed- : public function get_all_medical_centers(){ $data= DB:: table(‘medicalcenters’) ->join(‘medicalcenters’,’medicalcenters.id’,"=",’medicalcenters.parent_id’) ->join(‘countries’,’medicalcenters.country_id’,"=",’countries.id’) ->join(‘states’,’medicalcenters.country_id’,"=",’states.id’) ->join(‘cities’,’medicalcenters.country_id’,"=",’cities.id’) ..

Read more