Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    UncertaintyP
    @UncertaintyP
    Define best
    Kabocha ๐Ÿˆ
    @kabochallah_twitter
    Hey all, does anyone have experience with the RecursiveArrayIterator? I'm not sure what I'm trying to do is possible, any suggestions? https://stackoverflow.com/questions/67217957/flatten-nested-associative-array-while-preserving-key-value-groups - thanks!
    Ricardo Striquer Soares
    @rstriquer
    Hey guys. I was involved in a laravel 5 project, now they throw me in a laravel 8 and there is a doubt about the presenters, it is no longer available in v8?
    edvordo
    @edvordo
    What do you mean by presenters?
    Ricardo Striquer Soares
    @rstriquer
    I thought it was something from Laravel, but it seems to be something used in some companies I worked for. It is a class that "in a certain way" extends the model and can manipulate its data to present the information in the view. Say, p. eg, you wants to ensure that whenever you present the phone it always uses a mask, that presenter would apply the mask and ensure it is the standard presentation for that field. The idea is always reference the Presenter instead of the direct field when including the field in a view.
    long story short, forget me and ignore my last message. It's something from the system I'm working on, not something from Laravel. Thanks.
    edvordo
    @edvordo
    Fair enough. I mean, if it's a package of some sorts (which I asume it is, since you said you used it in multiple companies), look it up and see if they support the latest laravel release. :)
    haithemdd
    @kirafel
    hey guys
    dboss
    @lempx
    @kirafel helo
    Andrius Solopovas
    @asolopovas
    Hi guys, does anyone know how to remove vue&type=script&lang=ts& from source maps in laravel mix when running vue with typescript because browser sources are not mapped correctly with project files because of that?
    Jannik Malken
    @MannikJ
    Is there a way to list the oldest cache entries?
    edvordo
    @edvordo
    Depends on the driver being used
    But generally, no .. not in one call anyway .. with filesystem you'd have to check the files timestamp for example .. memcached won't give you the time it was first cached .. not sure about redis ..
    maybe if the db driver was used, but I wouldn't recommend using that
    furopi
    @furopi
    When does laravel ui gets updated to bootstrap 5?
    furopi
    @furopi
    Sorry for my bad English....
    Gael Duval
    @gduval_gitlab
    @furopi I believe laravel/ui is depreciated and won't be updated anymore. I may be wrong tho
    edvordo
    @edvordo
    yea, laravel/ui is a legacy package that isn't going to be updated .. laravel/breeze is somewhat a drop-in solution for it tho, with minor modifications ..
    Gael Duval
    @gduval_gitlab
    Hello there ๐Ÿ‘‹ I'm about to start a big project and i'll need a solid API tech, what do you guys think about Laravel Lumen ? Is it good ?
    Sahil Bhatia
    @sahilofficial671
    Laravel Lumen is a micro framework. You cannot base big projects on an micro-framework.
    edvordo
    @edvordo
    You absolutely can build big projects on Lumen, I just wouldn't recommend it. Lumen is a thing of the past, when speed was important, but with last few versions of PHP it's no longer a factor and I'd go for the full framework always.
    Gael Duval
    @gduval_gitlab
    Thx for your answers @sahilofficial671 , @edvordo . I actually though Lumens was kind of a new thing, but it explains why they are comparing it with Silex, which is depreciated. Thanks for your feedback.
    Gael Duval
    @gduval_gitlab
    To be honest, i'm a little concerned about starting my project with a Laravel API. Would you go for Laravel (if it's your main stack) to build a big API, or would you go more on Node, Rails and stuff ? I clearly don't want to spend months building an API with laravel if it's not a good tech for it ๐Ÿ˜•
    edvordo
    @edvordo
    Depends what your API is supposed to do, but if it's going to be a bunch of REST endpoints, Laravel is more than good enough, at least imho.
    MohameddAli
    @MohameddAli
      // Check whether the Submit Button is Clicked or not
      if(isset($_POST['submit']))
      {
        //echo "Cliked";
        //1. Get the Data From Form
        $id=$_POST['id'];
        $current_password = md5($_POST['current_password']);
        $new_password =md5($_POST['new_password']);
        $confirm_password  = md5($_POST['confirm_password']);
        //2.Check whether the user with current id and password exist or not
        $sql = "SELECT * FROM tbl_admin WHERE id=$id AND password='$current_password'";
        // Execute the Query
        $res = mysqli_query($conn,$sql);
        if($res==true)
        {
          //Check whether data is avilable or not
          $count = mysqli_num_rows($res);
          if($count==1)
          {
            //User Exist and Password Can be Changed
            //echo "User Found";
            //Check whether the new password and confirm match or not
            if($new_password==$confirm_password)
            {
              //Update the Password
              //echo "Password Match";
              $sql2 = "UPDATE tbl_admin SET passowrd = '$new_password' WHERE id=$id";
              //Execute the Query
              $res2 = mysqli_query($conn, $sql2);
              //Check whether the query executed or not
              if($res2==true)
              {
                //Display Succes Message
                //Redirect to MNG Admin Page with Success Message
                $_SESSION['change-pwd'] = "<div class='success'>Password Changed Successfully.</div>";
                //Redirect the User
                header('location:'.SITEURL.'admin/mng-admin.php');
              }else{
                //Display Erorr Message
                //Redirect to MNG Admin Page with Erorr Message
                $_SESSION['change-pwd'] = "<div class='error'>Failed to Change Password.</div>";
                //Redirect the User
                header('location:'.SITEURL.'admin/mng-admin.php');
                }
             }
             else
             {
              //Redirect to MNG Admin Page with Erorr Message
              $_SESSION['pwd-not-match'] = "<div class='error'>Password Did Not Match.</div>";
              //Redirect the User
              header('location:'.SITEURL.'admin/mng-admin.php');
            }
          }else{
            //User Does not Exist Set Message and Redirect
            $_SESSION['user-not-found'] = "<div class='error'>User Not Found.</div>";
            //Redirect the User
            header('location:'.SITEURL.'admin/mng-admin.php');
          }
    
        }
        //3. Check whether the New Password and Confirm Password Match or Not
    
        //4. Change Password if all above is true
    
      }
    
    
    ?>
    any one can help ??
    when i go for change password he tell me Failed to Change Password !!
    Stefan Schlombs
    @StefanSchlombs1980
    "UPDATE tbl_admin SET passowrd = '$new_password' WHERE id=$id"
    Must be
    "UPDATE tbl_admin SET password = '$new_password' WHERE id=$id"
    Please Enable the Error Messages :) .
    UncertaintyP
    @UncertaintyP
    Please do not use this code online because it introduces MySQL injection attacks
    Veselin Ivanov
    @vessivanov

    Hello Everyone!

    I've got a issue with osiset / laravel-shopify I hope someone will help.

    I've installed the plugin and I followed the instructions for installation.
    Now, I received the following error when I call the api method:

    Error
    Call to undefined method stdClass::api()

    My user model:

    use Osiset\ShopifyApp\Contracts\ShopModel as IShopModel;
    use Osiset\ShopifyApp\Traits\ShopModel;
    
    class User extends Authenticatable implements IShopModel
    {
        use Notifiable, ShopModel;
    ...

    My controller:

        public function themeUpdate(ShopvoteShops $shopvoteShop, $request = null)
        {
            $user = DB::table('users')->first();
            $shopvoteShop = ShopvoteShops::where('url', $user->name)->first();
            $shop = Auth::user();
    
            $response = $user->api()->rest('GET', '/admin/script_tags.json');

    Basically, the instances User and Auth everytime are empty and I can't call for example $shop->api(), because Error Call to a member function api() on null.
    I will be glad to hear how to fix this issue.
    Thank you!

    edvordo
    @edvordo
    Does that route use the auth middleware? Sounds like it isn't, that's why you are getting the second error (api() on null)
    As for the first error, you are using the DB facade, which doesn't resolve into a User model, that's what the error is pretty much telling you. To get User model, you should use User::first()
    4 replies
    Aju Chacko
    @ajuchacko91
    UncertaintyP
    @UncertaintyP
    ?
    Aju Chacko
    @ajuchacko91

    curl -s โ€œhttps://laravel.build/example-appโ€ | bash
    cd example-app
    ./vendor/bin/sail up
    sail composer require laravel/breeze --dev
    sail artisan breeze:install react
    sail artisan migrate
    sail npm install
    sail npm run prod

    I ran these commands to set up a project with laravel/breeze but the view is breaking

    any idea why would that be?
    Aju Chacko
    @ajuchacko91
    but it would work if I ran npm run dev
    @UncertaintyP
    edvordo
    @edvordo
    not sure why you are taggin UncertaintyP, but the issue might with be with css purging ..
    Aju Chacko
    @ajuchacko91
    ๐Ÿ˜€
    He has answered my questions previously thatโ€™s why, I tag him
    okay
    UncertaintyP
    @UncertaintyP
    I don't use Mix, Tailwind, Sail or Breeze ...
    Aju Chacko
    @ajuchacko91
    interesting
    this lead me to not use breeze instead I installed everything and all is good
    xlcrr
    @xlcrr
    I am looking for open source devs to help build openlittermap.com - github,com/openlittermap we are turning cleaning the planet into a game
    Andrius Solopovas
    @asolopovas

    Hi. Does anyone know why Route::model in RouteServiceProvider causes all routes to collapse?

      public function boot()
        {
    
            Route::model('area', Area::class);
            Route::model('status', Status::class);
    
            $this->configureRateLimiting();
            $this->routes(function() {
                Route::prefix('api')
                     ->middleware('api')
                     ->namespace($this->namespace)
                     ->group(base_path('routes/api.php'));
    
                Route::middleware('web')
                     ->namespace($this->namespace)
                     ->group(base_path('routes/web.php'));
            });
        }

    web.php

    Route::view('/{any}', 'app')->where('any', '.*');

    If you see area explicit model binding does not cause such issue but if I do it with Status all of my routes stop working and return not found, another thing that I observed is that eloquent make a query to find an id 200

    Andrius Solopovas
    @asolopovas
    If I change it to Route::model('statuses', Status::class); it works as well
    Ruan Lamprecht
    @RookieSA
    Hi all :)
    Whatโ€™s your thoughts on crowd-development? A joint effort of sorts, where collaborators share interest and ownership of a particular software.