I am attempting to create a x-select component where I can pass an array of options as one of the attributes. Here is create.blade.php: <?php $list = [‘Received’, ‘In Process’, ‘Repaired’, ‘Completed’, ‘Shipped’, ‘Waiting on Boards’, ‘In Route’];?> <x-select id="progress" class="block mt-1 w-full" name="progress" :value="old(‘progress’)" :list="$list" /> Here is the component select.blade.php @props([‘disabled’ => false]) ..

Read more

Hello world i just completed developing laravel web in the localhost everything work fine but when i Booking hosting in webhostface.com i have tow problem Error one is file_put_contents(D:webAPIstorageframework/sessions/r62WPTDKAhf5shlupWGhJzMv5U9BtEdzxrKYaGN5): failed to open stream: No such file or directory and the problem tow is Class ‘IlluminateViewFactory’ not found Knowing that I have made sure that all ..

Read more

I’ve required Laravel Orchid and Ochid Icons, but I have a problem with OrchidIcons: Target class [AppViewComponentsOrchidIcon] does not exist. I’ve required OrchidIconsIconServiceProvider::class, to app service provider. IconServiceProvider.php has the following code public function register() { $this->app->singleton(IconFinder::class, static function () { return new IconFinder(); }); Blade::component(‘orchid-icon’, IconComponent::class); } I use Laravel 8 and i know ..

Read more

The IDE endlessly reminds us to use contracts when we type-hint function parameters with a model. I gave in and tried to do the right thing by defining an interface + abstract class for the model. I proceeded to add an interface and an abstract class that is extended by the model. <?php namespace AppModelsI18n; ..

Read more

I have laravel 8 project and I am facing issue with controller which is in subfolder. I have DashboardController located in /app/Http/Controllers/Dashboard. In my web.php I have: use AppHttpControllersDashboardDashboardController; Route::get(‘dashboard’, [DashboardController::class, ‘dashboardView’]); DashboardController has this namespace: namespace AppHttpControllersDashboard; I have tried uncomment $namespace variable in RouteServiceProvider.php. Also I have added: ->namespace($this->namespace); in boot() method. But ..

Read more

So my code is $categories=Category::where(‘user_id’, $store->id)->whereHas(‘childrenCategories’, function($q) use ($id){ $q->where(‘user_id’, $id); })->orwhereHas(‘products’, function($q) use ($id) { $q->where(‘auth_id’, $id); })->with(‘products’, ‘childrenCategories’)->latest()->get(); I want to get all children categories with and products with given id but this code doesn’t seem to work. As children categories with user_id other than id are also being returned. Sorry, I am ..

Read more

i have two tables with two models and make a reactionship to can get the field_name from the first table :- first Model: class KpcField extends Model { public function concession(){ return $this->hasMany(Concessions::class); } } second model : class Concessions extends Model { public function kpcField(){ return $this->belongsTo(KpcField::class); } } and trying to retreive the ..

Read more

Is there possibility to get whole database’s table with it’s associates? My example class Gambler extends Model { use HasFactory; public function horse() { return $this->belongsTo(Horse::class, ‘horse_id’, ‘id’); } } I am fetching data of Gamblers with axios, wich is being returned with this code in controller public function getGamblers () { echo Gambler::all(); } ..

Read more

Basically what I have is a laravel 7 based application running on one ec2 instance under some route53 hosted zones. No load balancers, no cloudfront, no cognito. I have a subdomain, let’s say sub.domain.com of domain.com. Now, through laravel routing and stuff all requests to sub.domain.com basically change the context of the app, some custom ..

Read more

I am trying this code but in whith where query does not work any One can solve this problem? Quotation::with([‘QuoParts’, ‘client’=>function($cq){ $cq->orWhere(‘first_name’, ‘LIKE’, ‘%Muhammad%’); }, ‘user’])->orWhere(function($q) use ($s){ $q->orWhere(‘sku’, ‘LIKE’, ‘%’.$s.’%’); $q->orWhere(‘issue_date’, ‘LIKE’, ‘%’.$s.’%’); })->take($length)->skip($r->start)->get(); Sourc..

Read more

this is my logout function in front end react : async logout (){ await Csrf.getCookie(); console.log(localStorage.getItem("token")) return Api.post("user/logout",{},{ headers:{ Accept: "application/json", Authorization :`Bearer ${localStorage.getItem("token")}` } }); } and then this is logout route function in laravel, im using sanctum to authenticate SPA, public function logout(Request $request){ $token = $request->user("admin")->currentAccessToken()->delete(); return ResponseFormatter::success($token, ‘Token Revoked’); } i ..

Read more

This is my AssignmentController Store function. (This is my AssignmentController Store function.) This is my AssignmentController Store function. (This is my AssignmentController Store function.) public function store(Request $request) { $request->validate(array( ‘assignment’ => ‘array|required’, ‘assignment.*.staff_id’ => ‘required’, ‘assignment.*.task_id’ => ‘required’, ‘done_at’ => ‘sometimes’, )); foreach($request->get(‘assignment’) as $assignment) $assignment = Assignment::create(array( ‘staff_id’ => $assignment[‘staff_id’], ‘task_id’ => $assignment[‘task_id’], ..

Read more

hello friends I want to ask, why the data is not deleted? I have clicked on it but in the database it is not deleted. My php version 8 migration public function up() { Schema::create(‘role_akun’, function (Blueprint $table) { $table->id(); $table->string(‘nama_role’)->unique(); $table->string(‘roles’); $table->timestamps(); }); } controller in function destroy public function destroy(ManageROle $manageROle) { $manageROle->delete(); ..

Read more

accourding to this post : laravel-sanctum-custom-guard i want to make Auth that only work for specific guard ex : Auth::guard("admin") but default method that i know is : (only for default guard) $credentials = request([‘username’, ‘password’]); Auth::attempt($credentials) and also i need how to logout with specific guard default logout user is : Auth::logout(); i really ..

Read more