Ramazan

Ramazan

Member Since 1 Year Ago

Experience Points
1,970
Total
Experience

3,030 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-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-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-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist 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
1,970 XP
Nov
02
1 week ago
Activity icon

Replied to How To Make Edit And Update Multi Select Form Value

i have no error but i want to send data from db to form for editing my form is multi select and i don't know how to and what is the update logic for a multi select inputs value thanks

Activity icon

Started a new Conversation How To Make Edit And Update Multi Select Form Value

i want edit and update the hostel facility that each hostel hasMany facilities so how to make edit and update the multi select values

<div class="form-group m-form__group row">
            <label class=" col-lg-12 col-sm-12 " style="">select facility</label>
            <div class="col-md-12 col-sm-12">
                <select class="form-control m-select2" id="m_select2_2_3" name="facility_name[]"
                        multiple="multiple">
                    <optgroup label="Eastern Time Zone">
                        <option value="internet"  >internet</option>
                        <option value="book">book</option>
                        <option value="coffiee">coffiee</option>
                        <option value="chairs">chairs</option>
                    </optgroup>
                </select>

            </div>
        </div>

my controller

    public function edit($id)
    {
        //
        if ($id && ctype_digit($id)){
            $hostel = Hostel::find($id);
            // if the object is
            if ($hostel && $hostel instanceof Hostel){

                return view('cms/hostel/hostel_create', compact('hostel'));
            }
        }

    }
//$hostels = Hostel::with('address')->get();
    /**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \App\hostels  $hostels
     * @return \Illuminate\Http\Response
     */
    public function update(Request $request , $id)
    {
        //


        $input = [
            'name' => request()->input('name'),
            'type' => request()->input('type'),
            'phone' => request()->input('phone'),
            'email' => request()->input('email'),
            'description' => request()->input('description'),
        ];

        $hostel = Hostel::find($id);
        $hostel->update($input);
        return redirect()->route('hostel.index');

    }
Oct
30
1 week ago
Activity icon

Replied to How To Send HasOne Relation Data For Edit In Select2 Forms

address is belongs to hostel and hostel hasone address how to send the data for update and edit

Activity icon

Started a new Conversation How To Send HasOne Relation Data For Edit In Select2 Forms

i want to send the hostel address for editing in to from i have used select2 form each hostel hasOne address so how to send the address for editing with hostel in one controller this is my edit method for hostel detials

  public function edit($id)
    {
        //
        if ($id && ctype_digit($id)){
            $hostel = Hostel::find($id);
            // if the object is
            if ($hostel && $hostel instanceof Hostel){
                return view('cms/hostel/hostel_create', compact('hostel'))
            }
        }

    }
Activity icon

Replied to I Got This Error While Updating The Inputs Records

this is my controller

 public function update(Request $request , $id)
    {


        $owner_input = [
            'name'              => request()->input('name'),
            'email'             => request()->input('email'),
            'phone_number'      => request()->input('phone_number'),
            'fb'                => request()->input('fb'),
            'insta'             => request()->input('insta'),
            'linkedIn'          => request()->input('linkedIn'),
            'twitter'           => request()->input('twitter')
        ];


        $owners = Owner::find($id);
        $owners->update($owner_input ,$owners);
        return redirect()->route('owner.index');

    }
Activity icon

Started a new Conversation I Got This Error While Updating The Inputs Records

this is the errors

Argument 2 passed to Illuminate\Database\Eloquent\Model::update() must be of the type array, object given, called in
Activity icon

Replied to How To Call The OneToMany Relation In Laravel Blade

my blade codes

<div class="m-portlet">
                    <div class="m-portlet__body m-portlet__body--no-padding">
                        @if($hostels && count($hostels))
                        <div class="m-invoice-2">
                            @foreach($hostels as $hostel)
                                <div class="m-invoice__wrapper">
                                    <div class="m-invoice__head"
                                         style="background-image: url(../../assets/app/media/img//logos/bg-6.jpg);">
                                        <div class="m-invoice__container m-invoice__container--centered">
                                            <div class="m-invoice__logo">
                                                <a href="#">
                                                    <h1>{{$hostel->name}}</h1>
                                                </a>
                                               

                                            </div>
                                            <span class="m-invoice__desc">
                                                            <span>{{$hostel->email}}</span>
                                                            <span>{{$hostel->phone}}</span>
                                                        </span>
                                            <div class="m-invoice__items">
                                                <div class="m-invoice__item">
                                                    <span class="m-invoice__subtitle">اfacilites</span>
                                                    @foreach($facilities as $facility)
                                                        <span class="m-invoice__text">{{$facility->facility_name}}</span>
                                                    @endforeach
                                                </div>
                                                <div class="m-invoice__item">
                                                    <span class="m-invoice__subtitle">details</span>
                                                    <span class="m-invoice__text">{{$hostel->name}}</span>
                                                    @if($hostel->type = 0)
                                                        <span class="m-invoice__text"> male</span>
                                                    @else()
                                                        <span class="m-invoice__text">female</span>
                                                    @endif
                                                </div>
                                                <div class="m-invoice__item">
                                                    <span class="m-invoice__subtitle">address</span>

                                                        <span class="m-invoice__text">{{$hostel->address->province}}<br> state :</span>

                                                </div>
                                            </div>
                                        </div>
                                    </div>
                            


                                        <div class="col-md-2">

                                        </div>
                                    </div>
                                </div>
                            @endforeach
                        </div>
                        @endif
                    </div>
Activity icon

Replied to How To Call The OneToMany Relation In Laravel Blade

this solution has error my relation is hasOne

Trying to get property of non-object (View: C:\xampp\htdocs\hostel\resources\views\cms\hostel\hostel_index.blade.php
Activity icon

Replied to How To Call The OneToMany Relation In Laravel Blade

this is my blade but does not work

  @foreach($hostel->address as $addres)
                                                        <span class="m-invoice__text">{{$addres->province}}<br> state :{{$addres->state}}</span>
    @endforeach
Activity icon

Replied to How To Call The OneToMany Relation In Laravel Blade

i have read the doc help me with my code please

Activity icon

Started a new Conversation How To Call The OneToMany Relation In Laravel Blade

i want show the hostel address in laravel blade each hostel has one address how to call the hostel address in laravel blade this is my models and contrllers

class Address extends Model
{
    // Address belongs to hostel
    public function hostels()
    {
      return $this->belongsTo(Hostel::class);
    }
}

hostel model

class Hostel extends Model
{
  

    // hostel has one address
    public function addresses()
    {
      return $this->hasOne(Address::class);
    }
}

this is the controller


   public function index()
    {
        $hostels = Hostel::all();
        $facilities = Facility::all();
        $address = Address::all();
        $Rooms = Room::all();
        return view('cms.hostel.hostel_index', compact('hostels','facilities' , 'Rooms' , 'address'));
    }

Oct
15
3 weeks ago
Activity icon

Replied to How To Store Dropzone In Laravel

this is the dropzone form

 <form class="m-form m-form--fit m-form--label-align-rightx" method="post" action="{{route('hostel.store')}} " enctype="multipart/form-data">
               @csrf
               <div class="form-group m-form__group row">
                   <div class="col-lg-12 col-md-12 col-sm-12">
                       <div class="m-dropzone dropzone m-dropzone--success dz-clickable form-Controller" action="{{route('hostel.store')}}" id="m-dropzone-three"  name="file" >
                           <div class="m-dropzone__msg dz-message needsclick">
                               <h3 class="m-dropzone__msg-title">drop your photos here</h3>
                               <span class="m-dropzone__msg-desc">only photos</span>
                           </div>
                       </div>
                   </div>
               </div>
</form>
Activity icon

Replied to How To Store Dropzone In Laravel

i have allowed but the dropezone dose't work this is the dropzone javascript

var DropzoneDemo = {
   init: function () {
       Dropzone.options.mDropzoneOne = {
           paramName: "file",
           maxFiles: 1,
           maxFilesize: 5,
           addRemoveLinks: !0,
           accept: function (e, o) {
               "justinbieber.jpg" == e.name ? o("Naha, you don't.") : o()
           }
       }, Dropzone.options.mDropzoneTwo = {
           paramName: "file",
           maxFiles: 10,
           maxFilesize: 10,
           addRemoveLinks: !0,
           accept: function (e, o) {
               "justinbieber.jpg" == e.name ? o("Naha, you don't.") : o()
           }
       }, Dropzone.options.mDropzoneThree = {
           paramName: "file",
           maxFiles: 10,
           maxFilesize: 10,
           addRemoveLinks: !0,
           acceptedFiles: "image/*,application/pdf,.psd",
           accept: function (e, o) {
               "justinbieber.jpg" == e.name ? o("Naha, you don't.") : o()
           }
       }
   }
};
DropzoneDemo.init();
Oct
09
1 month ago
Activity icon

Started a new Conversation How To Store Dropzone In Laravel

i want store mulitple image in table by this dropzone this is my blade


            <!--begin::Form-->
            <form class="m-form m-form--fit m-form--label-align-rightx" method="post" action="{{route('hostel.store')}}">
                {{csrf_field()}}


                <div class="form-group m-form__group row">
                    <div class="col-lg-12 col-md-12 col-sm-12">
                        <div class="m-dropzone dropzone m-dropzone--success dz-clickable form-Controller" action="{{route('hostel.store')}}" id="m-dropzone-three"  name="file">
                            <div class="m-dropzone__msg dz-message needsclick">
                                <h3 class="m-dropzone__msg-title">عکس های خوابگاه را برای اپلود دراینجا بکشید ویا کیلیک کیند.</h3>
                                <span class="m-dropzone__msg-desc">تنها عکس قابل بارگذاری میباشد</span>
                            </div>
                        </div>
                    </div>
                </div>
</form>
Oct
08
1 month ago
Activity icon

Replied to Multi Select Dropdwon

thank you. the implode is storing multi item in one row cloud you help me with jason_encode foreach i got this error with my foreach Invalid argument supplied for foreach() this is my foreach loop

foreach ($request->facility as  $facility) {
  // code...
  $facility = new Facility;
  $facility->facility_name = json_encode($request->facility_name);
  $facility->save();
}
Activity icon

Replied to Multi Select Dropdwon

this is the table

  public function up()
    {
        Schema::create('facilities', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('facility_name');
            $table->unsignedInteger('hostel_id');
            $table->softDeletes();
            $table->timestamps();
        });
    }
Activity icon

Replied to Multi Select Dropdwon

this is my blade

      <div class="form-group m-form__group row">
                                    <label class=" col-lg-12 col-sm-12 " style="" >select the time Zone</label>
                                    <div class="col-md-12 col-sm-12">
                                      <select class="form-control m-select2" id="m_select2_3" name="facility_name[]" multiple="multiple">
                                        <optgroup label="Eastern Time Zone">
                                          <option value="CT">Connecticut</option>
                                          <option value="DE">Delaware</option>
                                          <option value="FL">Florida</option>
                                          <option value="GA">Georgia</option>
                                      
                                        </optgroup>
                                      </select>
                                    </div>
                                  </div>
                </div>

this is the controller

    public function store(Request $request)
    
    {
      foreach ($request->facility as  $facility) {
        // code...
        $facility = new Facility;
        $facility->facility_name = $request->facility_name;
        $facility->save();
      }
]

Activity icon

Started a new Conversation Multi Select Dropdwon

how to save the multi select values from dropdown in laravel