hariprasatn

hariprasatn

Member Since 2 Months Ago

Experience Points
190
Total
Experience

4,810 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
0
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start your engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-in-session Created with Sketch.

    School In Session

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

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

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

  • subscriber Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist Created with Sketch.

    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 Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

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

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

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

Level 1
190 XP
Feb
27
1 month ago
Activity icon

Replied to Laravel Subtracting 2 Columns And Showing The Results

if i want to persist in database, can you guide me.

Activity icon

Started a new Conversation Laravel Calculation (substraction)

Hey guys, in my database have three column which is x, y and z. Is that possible to do x-y=z in database i try to do, its work but once i reload its disappear, so its not storing in database im new to laravel, i hope you can guide me. Thanks

Jan
23
2 months ago
Activity icon

Replied to Can't Save Fetched Login User Name To Relationship

@snapey i tried to remove the user and create the form , but when other user login they can see all user detail if didn't select the user name.

Activity icon

Replied to Can't Save Fetched Login User Name To Relationship

@bobbybouwmann i already change to update but it still not working

Activity icon

Started a new Conversation Can't Save Fetched Login User Name To Relationship

i creating a form to user once login, so they have to insert all in empty field except for the user name because i fetch from registered username. the database table for this from and registered user is different, so i create relationship for login user and this form. i don't know where is the error, with this code once i fill-up and submit the form it didn't show any error

my blade

<form method="POST" action="{{ route("admin.customers.store") }}" enctype="multipart/form-data">
    <h2 style="text-align: center"> User Details Form</h2> <br>
    <div class="row">
        @csrf
        <div class="col-md-6">
            <label for="name">{{ trans('cruds.customer.fields.user') }}</label>
            <input class="form-control select2" type="text" name="name" value="{{ auth()->user()->name }}">
        </div>

        <div class="col-md-6 {{ $errors->has('company_name') ? 'has-error' : '' }}">
            <label class="required" for="company_name">{{ trans('cruds.customer.fields.company_name') }}</label>
            <input class="form-control" type="text" name="company_name" id="company_name" value="{{ old('company_name', '') }}" required>
            @if($errors->has('company_name'))
                <span class="help-block" role="alert">{{ $errors->first('company_name') }}</span>
            @endif
            <span class="help-block">{{ trans('cruds.customer.fields.company_name_helper') }}</span>
        </div>

controller


    public function store(StoreCustomerRequest $request)
    {
        $customer = Customer::create($request->all());

        $attributes = request()->validate([
            'name' => 'required'
        ]);
        auth()->user()->save($attributes);
        
        return redirect()->route('admin.customers.index');
    }

Or

If i use the below code it works perfectly but the login user can select other users too, i dont want the login user preview or select other users name.

maybe if you can help me solve this part then the top part i no need to do.

<div class="form-group {{ $errors->has('user') ? 'has-error' : '' }}">
    <label for="user_id">{{ trans('cruds.customer.fields.user') }}</label>
    <select class="form-control select2" name="user_id" id="user_id">
        @foreach($users as $id => $user)
            <option value="{{ $id }}" {{ old('user_id') == $id ? 'selected' : '' }}>{{ $user }}</option>
        @endforeach
    </select>
    @if($errors->has('user_id'))
        <span class="help-block" role="alert">{{ $errors->first('user_id') }}</span>
    @endif
    <span class="help-block">{{ trans('cruds.customer.fields.user_helper') }}</span>
</div>
Jan
22
2 months ago
Activity icon

Replied to Php Artisan Migrate:fresh Error

yes there is different migration @tykus

    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->increments('id');

            $table->string('name')->nullable();

            $table->string('email')->nullable()->unique();

            $table->datetime('email_verified_at')->nullable();

            $table->boolean('last_login_at')->nullable();

            $table->string('password')->nullable();

            $table->string('remember_token')->nullable();

            $table->boolean('approved')->default(0)->nullable();

            $table->timestamps();

            $table->softDeletes();

        });
Activity icon

Started a new Conversation Php Artisan Migrate:fresh Error

i'm getting this error

   Illuminate\Database\QueryException  : SQLSTATE[HY000]: General error: 1005 Can't create table `a`.`customers` (errno: 150 "Foreign key constraint is incorrectly formed") (SQL: alter table `customers` add con
straint `customers_last_login_at_foreign` foreign key (`last_login_at`) references `user` (`last_login_at`) on delete cascade)

here is my code

    $table->string('company_name')->nullable();

            $table->string('email');

            $table->integer('last_login_at')->unsigned();
            $table->foreign('last_login_at')
                ->references('id')->on('user')
                ->onDelete('cascade');

            $table->string('phone')->nullable();

            $table->string('address')->nullable();

            $table->string('pic');