Category : laravel-8

I have the error: Missing required parameters for [Route: shop.show] [URI: {language}/shop/{shop}]. (View: C:xampphtdocsfrileresourcesviewsincheader.blade.php) I think I understand my problem but I’m not sure. I’m trying to go to a detailpage of my product via a resource route. This works fine if I don’t have my language switcher on it. My language switcher needs the ..

Read more

I’m trying to utilize laravel passport for api authentication $user = User::create([ ‘first_name’ => $request->firstName, ‘last_name’ => $request->lastName, ’email’ => $request->email, ‘password’ => Hash::make($request->password), ‘verified’ => User::UNVERIFIED_USER, ‘capacity’ => User::REGULAR, ‘verification_token’ => User::generateVerificationToken(), ]); $token = $user->createToken(‘Laravel Password Grant Client’)->accessToken; return response()->json([‘data’ => $token]); and I’m getting this error: "message": "Method LaravelPassportBridgeAccessToken::__toString() must not throw ..

Read more

I want to use Google Authentication for signing users in to my website with Laravel. I have successfully installed socialite package and after creation of OAuth Client IDs, I added my credentials to .env file like this: GOOGLE_CLIENT_ID=SOMEID GOOGLE_SECRET_KEY=SOMEKEY GOOGLE_CALLBACK_URL=http://localhost:8000/auth/google/callback Then I added this to config/services.php: ‘google’ => [ ‘client_id’ => env(‘GOOGLE_CLIENT_ID’), ‘client_secret’ => env(‘GOOGLE_CLIENT_SECRET’), ..

Read more

Let’s say I have a login form like this: <form method="POST" action="{{ route(‘login’) }}"> @csrf <div class="field"> <span class="fas fa-user"></span> <input type="email" name="email" required> <label style="right:0;">Email</label> @error(’email’) <script type="text/javascript"> alert(‘Something went wrong’); </script> @enderror </div> <div class="field"> <span class="fas fa-lock"></span> <input type="password"> <label style="right:0;">Password</label> @error(’email’) <script type="text/javascript"> alert(‘Something went wrong’); </script> @enderror </div> <button>Login</button> </form> ..

Read more

In a create post form i have store the data into database using implode function because data was in array $this->posts->optional_info = implode(" ",$input[‘optional_info’]); now In edit form i want the data stored in database should get checked by default in view so i am trying like <div class="row"> @foreach($customArray[‘optional’] as $key => $value) <div ..

Read more

I’m working on my login.blade.php and I want to show an alert box if user faced an error while filling the form: <form method="POST" action="{{ route(‘login’) }}"> @csrf <div class="field"> <span class="fas fa-user"></span> <input type="email" name="email" required> <label style="right:0;">Email</label> @error(’email’) alert(‘Something went wrong’); @enderror </div> <div class="field"> <span class="fas fa-lock"></span> <input type="password"> <label style="right:0;">Password</label> @error(’email’) ..

Read more

so i stored array of images while created a form, but i store these in local public folder not in database. //controller public function store(Request $request) { if($request->hasFile(‘files’)) { foreach($request->file(‘files’) as $image) { $destinationPath = ‘public/uploads/’; $filename = $request->input(‘surf_date’).’_’.$request->input(‘user_id’).’_’.$image->getClientOriginalName(); $image->move($destinationPath, $filename); } } $data = $request->all(); $rules = array( ‘post_type’ => [‘required’], ‘user_id’ => [‘required’,’numeric’], ..

Read more