رفتن به مطلب
انجمن پشتیبانی لاراول ایران

هاست لاراول با پشتیبانی 24 ساعته و امکانات کامل از مدیرهاست

mq1379

کاربر
  • تعداد ارسال ها

    15
  • تاریخ عضویت

  • آخرین بازدید

پست ارسال شده توسط mq1379


  1. من سیستم ثبت نام و لاگین کاربرای سایتم رو با laravel ui راه اندازی کردم. بعد از ثبت نام هر کاربر سعی میکنه یه ایمیل ارسال کنه اما تو کدش هیچ جایی ایمیل ارسال نمیکنه میتونید بگید از کجا باید پیداش کنم و جلوی این قضیه رو بگیرم؟


  2. سلام من چند وقتیه که روی هاست اصلی با اتصال به ایمیل مشکل دارم و اررور زیر رو میگیرم
    Expected response code ۳۵۴ but got code "۵۰۳", with message "۵۰۳-All RCPT commands were rejected with this error: ۵۰۳-authentication required ۵۰۳ Valid RCPT command must precede DATA "
    فکر میکنم این اررور برای authentication باشه ولی هرکاری کردم برطرف نشده اگه میشه یه کمکی بکنید که خیلی گیرم

  3. من پر.ژه خودمو رو هاست آپلود کردم یونیشارپ فایل منیجر من بر خلاف لوکال اینجا توی پوشه storage که توی public_html هست چیزی رو آپلود نمیکنه و فقط توی پوشه storage که بیرون public هست آپلود میکنه میخواستم بدونم مشکلش چیه و اینکه اگه بخوام به همون فایلی که تو پوشه storage توی فایل اصلی پروژه هست چجوری باید از سایت بهش آدرس بدم؟


  4. من یه پروژه سایت صرافی ارز دیجیتال دارم و خب بحث امنیت خیلی مهمه و کاربر عادی نباید به بخش ادمین دسترسی داشته باشه من برای کاربرا role تعریف کردم و middleware گذاشتم و default role هم 2 هست و برا ادمین یک که ادمین رو خودم به صورت دستی تعریف میکنم میخوام بدونم صرف تعریف این middleware ها و استفاده از کلاس Auth توشون که بگه role کاربر چیه و بجای درست هدایت بشه کفایت میکنه یا حتما باید از یه پکیج برا این کار استفاده کنم؟

    ایا راهی هست که کاربر بتونه role خودش تو دیتا بیس رو عوض کنه؟ یا ازین جور مسائل که بخواد middleware رو دور بزنه؟

    اگ نکنته امنیتی مهم و پایه ای برای سایت میدونید بگید که رعایت کنم چون در این زمینه بجز حملات xss از بقیه اطلاعی ندارم


  5. سلام من میخوام تو چند جای سایتم یه سری عملیات با هم تو یه کنترلر انجام بشه اما ازونجا که این کارا به ترتیب انجام میشه و همه این کارا حیاتی است اگه اون وسط یه کدوم اررور بده همه چی خراب میشه یعنی یه سری کارا انجام شده یه سری نشده مثلا پول از کیف پول کاربر تو سایت کم شده اما درخواست برداشت به ادمین ارسال نشده یا برعکس شما راهی میدونید که بشه همه کارا رو همزمان انجام داد و اگه هر کدوم اررور داد بقیه انجام نشه؟


  6. من تو پروژم تو لوکال هاست تو سایتم لاگین میکنم ولی رو هاست اصلی نمیشه اینم کد فایل authenicatesusers.php هست میدونید مشکلش چیه ؟ خودم فکر میکنم به دیتابیس درست متصل نمیشه

     

    <?php
    
    namespace Illuminate\Foundation\Auth;
    
    use Illuminate\Http\JsonResponse;
    use Illuminate\Http\Request;
    use App\Models\Ip;
    use Illuminate\Support\Facades\Auth;
    use Illuminate\Validation\ValidationException;
    
    trait AuthenticatesUsers
    {
        use RedirectsUsers, ThrottlesLogins;
    
        /**
         * Show the application's login form.
         *
         * @return \Illuminate\View\View
         */
        public function showLoginForm()
        {
            return view('auth.login');
        }
    
        /**
         * Handle a login request to the application.
         *
         * @param  \Illuminate\Http\Request  $request
         * @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\Response|\Illuminate\Http\JsonResponse
         *
         * @throws \Illuminate\Validation\ValidationException
         */
        public function login(Request $request)
        {
            $this->validateLogin($request);
    
            // If the class is using the ThrottlesLogins trait, we can automatically throttle
            // the login attempts for this application. We'll key this by the username and
            // the IP address of the client making these requests into this application.
            if (method_exists($this, 'hasTooManyLoginAttempts') &&
                $this->hasTooManyLoginAttempts($request)) {
                $this->fireLockoutEvent($request);
    
                return $this->sendLockoutResponse($request);
            }
    
            if ($this->attemptLogin($request)) {
                return $this->sendLoginResponse($request);
            }
    
            // If the login attempt was unsuccessful we will increment the number of attempts
            // to login and redirect the user back to the login form. Of course, when this
            // user surpasses their maximum number of attempts they will get locked out.
            $this->incrementLoginAttempts($request);
    
            return $this->sendFailedLoginResponse($request);
        }
    
        /**
         * Validate the user login request.
         *
         * @param  \Illuminate\Http\Request  $request
         * @return void
         *
         * @throws \Illuminate\Validation\ValidationException
         */
        protected function validateLogin(Request $request)
        {
            $request->validate([
                $this->username() => 'required|string',
                'password' => 'required|string',
                recaptchaFieldName() => recaptchaRuleName(),
    
            ]);
        }
    
        /**
         * Attempt to log the user into the application.
         *
         * @param  \Illuminate\Http\Request  $request
         * @return bool
         */
        protected function attemptLogin(Request $request)
        {
            return $this->guard()->attempt(
                $this->credentials($request), $request->filled('remember')
            );
        }
    
        /**
         * Get the needed authorization credentials from the request.
         *
         * @param  \Illuminate\Http\Request  $request
         * @return array
         */
        protected function credentials(Request $request)
        {
            return $request->only($this->username(), 'password');
        }
    
        /**
         * Send the response after the user was authenticated.
         *
         * @param  \Illuminate\Http\Request  $request
         * @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\JsonResponse
         */
        protected function sendLoginResponse(Request $request)
        {
            $request->session()->regenerate();
    
            $this->clearLoginAttempts($request);
    
            if ($response = $this->authenticated($request, $this->guard()->user())) {
                return $response;
            }
          
                      if (!empty($_SERVER['HTTP_CLIENT_IP']))
                    //check ip from share internet
                    $ip = $_SERVER['HTTP_CLIENT_IP'];
                elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
                    //to check ip is pass from proxy
                    $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
                else
                    $ip = $_SERVER['REMOTE_ADDR'];
    
    
            Ip::create([
                'user_id' => auth()->user()->id,
                'user_role'=> auth()->user()->role,
                'user_level'=> auth()->user()->level,
                'ip' => $ip,
            ]);
    
            return $request->wantsJson()
                        ? new JsonResponse([], 204)
                        : redirect()->intended($this->redirectPath());
        }
    
        /**
         * The user has been authenticated.
         *
         * @param  \Illuminate\Http\Request  $request
         * @param  mixed  $user
         * @return mixed
         */
        protected function authenticated(Request $request, $user)
        {
            //
        }
    
        /**
         * Get the failed login response instance.
         *
         * @param  \Illuminate\Http\Request  $request
         * @return \Symfony\Component\HttpFoundation\Response
         *
         * @throws \Illuminate\Validation\ValidationException
         */
        protected function sendFailedLoginResponse(Request $request)
        {
            throw ValidationException::withMessages([
                $this->username() => [trans('auth.failed')],
            ]);
        }
    
        /**
         * Get the login username to be used by the controller.
         *
         * @return string
         */
        public function username()
        {
            return 'email';
        }
    
        /**
         * Log the user out of the application.
         *
         * @param  \Illuminate\Http\Request  $request
         * @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\JsonResponse
         */
        public function logout(Request $request)
        {
            $this->guard()->logout();
    
            $request->session()->invalidate();
    
            $request->session()->regenerateToken();
    
            if ($response = $this->loggedOut($request)) {
                return $response;
            }
    
            return $request->wantsJson()
                ? new JsonResponse([], 204)
                : redirect('/');
        }
    
        /**
         * The user has logged out of the application.
         *
         * @param  \Illuminate\Http\Request  $request
         * @return mixed
         */
        protected function loggedOut(Request $request)
        {
            //
        }
    
        /**
         * Get the guard to be used during authentication.
         *
         * @return \Illuminate\Contracts\Auth\StatefulGuard
         */
        protected function guard()
        {
            return Auth::guard();
        }
    }

     


  7. سلام من میخواستم تو سایتم یه باشگاه کاربران راه بندازم که هر کاربری یه لینک دعوت داشته باشه که افرادی بتونن ازون لینک ثبت نام کنند و یه عددی بعد از اون به دعوتهای کاربر اضافه بشه که بعدا بهش خدمات بیشتری داده بشه

    میخواستم بدونم لاراول همچین ویژگی داره که برای هر کاربر یه لینک دعوت درست کرد که بقیه ازون لینک ثبت نام کنن؟ 


  8. سلام من میخوام قیمت یک ارز رو از یک صفحه بگیرم که ثابت نیست به همین دلیل به طور مستقیم تو کدش نیومده و نمیتونم از ()file_get_contents استفاده کنم اینجا کسی روشی بلده که از ویو یه صفحه(چیزی که میبینیم نه سورسش)اطلاعات رو گرفت؟


  9. سلام من هیچی راجب ارسال درخواست api نمیدونم میخواستم داخل یک کنترلر یک درخواست api به url زیر ارسال کنم و از نتیجش همونجا استفاده کنم اگه میشه کدش رو بهم بگید که چجوری درخواست رو بفرستم و نتیجه ور به صورت json بگیرم

    https://api.coinex.com/v1/market/ticker/all


  10. سلام من یه سایت دارم راه اندازی میکنم که لازمه قیمت ارز ها رو به صورت لحظه ای از یه سایت بگیرم و نمایش بدم میخوام اون بخش صفحه که این کارو میکنه به صورت خودکار رفرش بشه نه کل صفحه در واقع اگه تو یه کنترلر عملیات گرفتن قیمت ارز از یه سایت انجام بشه میخوام اون کنترلر هی اجرا بشه اولش فک کردم با ایجکس باید انجام بدم اما ایجکس هم فقط وقتی صفحه رو باز میکنی اطلاعات رو رد و بدل میکنه نمیدونم چجوری خودکار همون یه بخش خاص رو رفرش کنم؟


  11. سلام ببخشید میخواستم بدونم چطور میشه تو لاراول یک سیستم پیام رسان ایجاد کرد به طور مثال بعد از ثبت نام کاربر یا خرید از فروشگاه جزییات رو در قالب یک پیام بفرسته به ادمین که ادمین بعد از ورود به داشبورد خودش بتونه اونارو مشاهده کنه

×
×
  • جدید...