memoLee

memoLee

Member Since 3 Months Ago

Experience Points 280
Experience
Level
Lessons Completed 0
Lessons
Completed
Best Reply Awards 0
Best Answer
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • Chatty Cathy Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

20 Sep
2 months ago

memoLee started a new conversation How To Manage ProductsController And ImagesController From The Same Form?

I have seperated databases; products and images. and they has own controller. Also I created relations between them. Now I dont know how to use different Controller for the same form. I want to store images and products to database with Add Product button. Note : I want to use imagesController not the Image model.

Here my [email protected] :

  /**
 * Store a newly created resource in storage.
 *
 * @param  \Illuminate\Http\Request  $request
 * @return \Illuminate\Http\Response
 */
public function store(Request $request, Product $product)
{
    request()->validate([
        'name'      => 'required|string',
        'description' => 'required|max:5000',
        // 'image' => 'required|file|image|mimes:jpeg,png,gif,webp',
        'price' => 'required|numeric',
        'compare_price' => 'required|numeric',
        'charge_tax' => 'boolean',
        'sku' => 'required|unique:products',
        'inventory' => 'required|numeric',
        // 'barcode' => 'required', required??
        'track_inventory' => 'required|boolean',
        'width' => 'required|numeric',
        'height' => 'required|numeric',
        'depth' => 'required|numeric',
        'weight' => 'required|numeric',
        'weight_type' => 'required',
        'extra_shipping_fee' => 'required|numeric',
    ]);


    $product = Product::create([
        'user_id'    => auth()->id(),
        'name'      => request('name'),
        'description' => request('description'),
        // 'image_path' => request()->file('image')->store(auth()->id().'images', 'public'),
        'price' => request('price'),
        'compare_price' => request('compare_price'),
        'charge_tax' => request('charge_tax'),
        'sku' => request('sku'),
        'inventory' => request('inventory'),
        'track_inventory' => request('track_inventory'),
        'width' => request('width'),
        'height' => request('height'),
        'depth' => request('depth'),
        'weight' => request('weight'),
        'weight_type' => request('weight_type'),
        'extra_shipping_fee' => request('extra_shipping_fee'),
    ]);

    

    if (request()->wantsJson()) {
        return response($product, 201);
    }

    return redirect('/products')
    ->with('flash', 'Product has been stored!');
}

And here my Images controller :

    /**
 * Store a newly created resource in storage.
 *
 * @param  \Illuminate\Http\Request  $request
 * @return \Illuminate\Http\Response
 */
public function store(Request $request, Product $product)
{
    if ($request->hasFile('images')) {
        foreach ($request->file('images') as $image) {
            $product->images()->create([
             'image_path' => $image->store(auth()->id().'images', 'public')
             ]);
        }
    }

}
12 Sep
3 months ago

memoLee left a reply on There Is Two Package.json File. What Should I Do?

You may misunderstood me. I mean one of this is laravel package.json and the other is templates package.json . I added on stackoverflow and it has a snapshot of the app directory of template. Please check it out there.

https://stackoverflow.com/questions/52301950/there-is-two-package-json-file-one-of-this-came-fom-template-what-should-i-do

memoLee left a reply on There Is Two Package.json File. What Should I Do?

Got it but with what ? webpack ? Also how can I merge two of package.json files?

memoLee left a reply on There Is Two Package.json File. What Should I Do?

These files not compiled files . Do I need that ?

memoLee left a reply on There Is Two Package.json File. What Should I Do?

what about saas and js files of template ?

memoLee started a new conversation There Is Two Package.json File. What Should I Do?

I have a project builded with laravel and need to add a template. But the template has own package.json node_modules etc.

What is the right way the handling this issue. Any help appreciated.

05 Sep
3 months ago

memoLee left a reply on How To Handle Multi Tabbed Modal Form Validation ?

Ahh, got it. thank you.You are my life saver :) @bobbybouwmann

I have a issue, with login page. Can you please also help me on this issue. Anyone didn't answered. https://laracasts.com/discuss/channels/laravel/login-and-register-on-the-same-page-laravel-56

04 Sep
3 months ago

memoLee left a reply on How To Handle Multi Tabbed Modal Form Validation ?

Thank you so much! Last question, Can I use axios instead of Ajax for this situation?(Template builded by jquery + BS4. So, I can't use vue. it will be too heavy, right?)

memoLee left a reply on Validation Rules And Modal Dialog

Can you please, help me to solve my multi tabbed modal problem? @bobbybouwmann

here my question on laracasts:https://laracasts.com/discuss/channels/general-discussion/how-to-handle-multi-tabbed-modal-form-validation

03 Sep
3 months ago

memoLee started a new conversation How To Handle Multi Tabbed Modal Form Validation ?

I am working on a modal that adds the product. The modal has seperated tabs which is needed to add product details. The question is that how can I handle validation.

Each tab has own form. And submit button is the same (in the modal footer not included the forms). shouldn't be single form? Also the "required" rule is not working. Any help please ?

30 Aug
3 months ago

memoLee started a new conversation Login And Register On The Same Page. Laravel 5.6

I am new on laravel. My login and register page is the same. So when I fill the register page with wrong credentials, errors appear on both login and register forms.

When the registration fail it should be focus on register page but it is focusing the login page.

What is the easiest way to make it work? Any suggestions? I don't know how to use error bags It would be fine if someone also tell me how to do it. Many thanks.

Here the code;

Laravel
<div id="login_content">
    <div class="logo">
        <img src="assets/img/logo/ml-logo.png" alt="logo" class="logo-img">
    </div>
    <h1 class="login-title">
        Sign In to your account
    </h1>
    <div class="login-body">
        <form method="POST" action="{{ route('login') }}">
            @csrf
            <div class="form-group label-floating is-empty">
                <label class="control-label">Email</label>
                <input type="email" name="email" class="form-control"  value="{{ old('email') }}" required>

                @if ($errors->has('email'))
                    <span class="invalid-feedback">
                        <strong>{{ $errors->first('email') }}</strong>
                     </span>
                @endif

            </div>
            <div class="form-group label-floating is-empty">
                <label class="control-label">Password</label>
                <input type="password" name="password" class="form-control" required>

                @if ($errors->has('password'))
                    <span class="invalid-feedback">
                        <strong>{{ $errors->first('password') }}</strong>
                    </span>
                @endif

            </div>
            <a href="javascript:void(0)" class="forgot-pass pull-right">Forgot Password?</a>
            <div class="checkbox inline-block">
                <label>
                    <input type="checkbox" class="checkbox-inline" value="">
                    Remember Me
                </label>
            </div>
            <button type="submit" class="btn btn-info btn-block m-t-40">Sign In</button>
            <div class="login-options">
                <span>OR</span>
                <hr/>
            </div>
            <div class="row">
                <div class="col-xs-12">
                    <button class="btn btn-facebook btn-block"><i class="zmdi zmdi-facebook"></i> Sign In with
                        Facebook
                    </button>
                </div>
                <div class="col-xs-12">
                    <button class="btn btn-google btn-block"><i class="zmdi zmdi-google-plus"></i> Sign In with
                        Google
                    </button>
                </div>
                <div class="col-xs-12">
                    <button class="btn btn-twitter btn-block"><i class="zmdi zmdi-twitter"></i> Sign In with Twitter
                    </button>
                </div>
            </div>
        </form>
    </div>
    <div class="login-footer p-15">
        <p>
            Don't have an account? <a href="javascript:void(0)" data-toggle="register">Create an account</a>
        </p>
    </div>
    <div id="register_wrapper">
        <ul class="card-actions icons right-top">
            <li>
                <a href="javascript:void(0)" data-toggle="register">
                    <i class="zmdi zmdi-close"></i>
                </a>
            </li>
        </ul>
        <div class="logo">
            <img src="assets/img/logo/ml-logo.png" alt="logo" class="logo-img">
        </div>
        <h1 class="login-title">
            Create an account
        </h1>
        <div class="login-body">
            <div class="col-xs-12">
                <button class="btn btn-facebook btn-block"><i class="zmdi zmdi-facebook"></i> Sign Up with Facebook
                </button>
            </div>
            <div class="col-xs-12">
                <button class="btn btn-google btn-block"><i class="zmdi zmdi-google-plus"></i> Sign Up with Google
                </button>
            </div>
            <div class="col-xs-12">
                <button class="btn btn-twitter btn-block"><i class="zmdi zmdi-twitter"></i> Sign Up with Twitter
                </button>
            </div>
            <form class="clear-both"  method="POST" action="{{ route('register') }}">
                @csrf
                <h2 class="text-center p-t-20">
                    Or sign up below
                </h2>
                <div class="form-group label-floating is-empty">
                    <label class="control-label">Name</label>
                    <input type="text" name="name" class="form-control" required>
                    @if ($errors->has('name'))
                        <span class="invalid-feedback">
                                    <strong>{{ $errors->first('name') }}</strong>
                                </span>
                    @endif
                </div>

                <div class="form-group label-floating is-empty">
                    <label class="control-label">Email</label>
                    <input type="email" name="email" class="form-control" required>

                    @if ($errors->has('email'))
                        <span class="invalid-feedback">
                                    <strong>{{ $errors->first('email') }}</strong>
                                </span>
                    @endif
                </div>

                <div class="form-group label-floating is-empty">
                    <label class="control-label">Password</label>
                    <input type="password" name="password" class="form-control" required>

                    @if ($errors->has('password'))
                        <span class="invalid-feedback">
                                    <strong>{{ $errors->first('password') }}</strong>
                                </span>
                    @endif
                </div>

                <div class="form-group label-floating is-empty">
                    <label class="control-label">Confirm Password</label>
                    <input type="password" name="password_confirmation" class="form-control" required>
                </div>

                <div class="checkbox inline-block">
                    <label>
                        <input type="checkbox" class="checkbox-inline" value="">
                        I agree to the <a href="javascript:void(0)">terms of services</a>
                    </label>
                </div>
                <button type="submit" name="submit" class="btn btn-info btn-block m-t-40">Create my account</button>
            </form>
        </div>
        <div class="login-footer p-15">
            <p>
                Already have an account? <a href="javascript:void(0)" data-toggle="register">Sign In</a>
            </p>
        </div>
    </div>
</div>