anandmainali5

Experience

3,850

0 Best Reply Awards

  • Member Since 5 Months Ago
  • 24 Lessons Completed
  • 0 Favorites

21st March, 2018

anandmainali5 started a new conversation How To Send Email Into Gmail From Laravel? • 3 months ago

I have a form for making appointment. Whenever users make a appointment the details of users must be sent to official gmail (ex:[email protected]). How can i do it ? Does i need to provide gmail-password in ".env" file. But my client doesn't want to share his password. How can i solve this ??

19th March, 2018

anandmainali5 left a reply on Fetching Only Image From Database • 3 months ago

@Sergiu17 thanks a lot for your answer. With your help i solved all the above problems.

anandmainali5 left a reply on Fetching Only Image From Database • 3 months ago

@Sergiu17 Thanks a lot. Everythings works fine. But i am getting all the images of that album. But i only want the first item of that album. And after clicking in it all the images associated with that album will displayed in different page.. How can i solve this?

anandmainali5 started a new conversation Fetching Only Image From Database • 3 months ago

I have a table 'albums' and the columns 'id','name' and another table 'images' and the columns 'id','album_id','image'. Now i want to display all the album name and the first image associated with that album. How can i do it??

17th March, 2018

anandmainali5 left a reply on How To Add Array Of Image In Db In A Single Row? • 3 months ago

hey somebody help me?

anandmainali5 started a new conversation How To Add Array Of Image In Db In A Single Row? • 3 months ago

I want to make a photo gallery. In which i want to show the title and first image from the array. And after clicking the image other image should be displayed in the another page with it. Every time i add a photos it should be created a album in the gallery? How can i make it? Can someone helpme to code this??

anandmainali5 started a new conversation Voyager Image Broken After Uploading In Server • 3 months ago

I uploaded my project into the root directory in cpanel and the public folder in a 'public_html'. Now when i add a image the image are not showing . How to fix it?

13th March, 2018

anandmainali5 started a new conversation Problem With Updating Role By All User In Voyager • 3 months ago

How to solve the problem of updating user role other than admin in voyager??

9th March, 2018

anandmainali5 started a new conversation Getting Error In Route • 3 months ago

``//Route

Route::delete('/cart/{product}','[email protected]')->name('cart.destroy');

//form

{{csrf_field()}} {{method_field('DELETE')}}

Why i am getting error "Route [] not defined"??

8th March, 2018

anandmainali5 left a reply on Access Denied For User 'root'@'localhost' (using Password: NO) • 3 months ago

Thanks!! But the problem is solved

anandmainali5 started a new conversation Access Denied For User 'root'@'localhost' (using Password: NO) • 3 months ago

SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO) (SQL: select * from sessions where id = I4acWY0LwZppE8foHCNokp5Fb3iJK2QD7pm4UrpG limit 1) in mysql. How to solve it?

7th March, 2018

anandmainali5 started a new conversation Help Plz!! How To Upload Laravel Projects Into Subfolders In Cpanel • 3 months ago

I want my project open when i enter the url http://abcnepal.com/laravel . How to do it? I have google it many times but it didn't work for me. I got pane not working error. How to fix it?

28th February, 2018

anandmainali5 started a new conversation Are There Any E-commerce Package To Create E-commerce Site Easily? • 3 months ago

I want to create e-commerce site same as amazon? Is there any easy way to create it?

anandmainali5 started a new conversation Is Vanilo Perfect To Create A E-commerce Site? • 3 months ago

I want to create a e-commerce site same as amazon. Is there any libraries to create e-commerce site? Is vanilo perfect?

30th January, 2018

anandmainali5 left a reply on Problem With DB Transactions • 4 months ago

@akilrajdho May be you must try "php artisan migrate:refresh" after you change the column name from invoice_id to invoice_ids.

anandmainali5 left a reply on How To Use Dropzone.js With Additional Field And Submit Button • 4 months ago

@burlresearch But when i drop the files it is automatically uploading. I also want extra text field in the form and when i hit the submit button then the data is submitted.

anandmainali5 left a reply on How To Use Dropzone.js With Additional Field And Submit Button • 4 months ago

@burlresearch Sorry but i am not a premium user.. Can u provide me some other ways to solve my problem.

anandmainali5 started a new conversation How To Use Dropzone.js With Additional Field And Submit Button • 4 months ago

I want to use Dropzone.js for multiple image upload. I also wanna add a image title field and the image should be uploaded when i hit the submit button? Can u plz help me??

anandmainali5 left a reply on How To Set Default Picture If User Doesn't Upload The Picture?? • 4 months ago

@Thyrosis Applying if condition in mutator works perfectly. I don't need to make my own function. Anyway thanks all of u.

    public function getImageAttribute($image){
        if ($image) {
           return $this->location.$image;
        }
        
    }

anandmainali5 left a reply on How To Set Default Picture If User Doesn't Upload The Picture?? • 4 months ago

I think that the mutator is placing the location while i call the image in my blade.. How to fix it?

anandmainali5 left a reply on How To Set Default Picture If User Doesn't Upload The Picture?? • 4 months ago

Yeah i've tried but it is not showing inside the if statement.

@if($association->image) @else @endif

I'm also using mutator in my code..

protected $location = '/Images/logo/'; public function getImageAttribute($image){ return $this->location.$image; }

anandmainali5 started a new conversation How To Set Default Picture If User Doesn't Upload The Picture?? • 4 months ago

I want to set a default photo for users if user left the upload field blank. And want to set the users photo if they upload their own picture?

28th January, 2018

anandmainali5 started a new conversation How To Fetch All Row Form Database Except One? • 4 months ago

I want to show all the users except the current user. How can i do it? Currently my code is

public function index() {

    $users = User::paginate(4);
    return view('admin.Users.index',compact('users'));
}

anandmainali5 left a reply on Two Forms In One Page • 4 months ago

@BezhanSalleh Thanks for solving my problem.

anandmainali5 left a reply on Two Forms In One Page • 4 months ago

@zainudinnoori No. Still the same problem.

anandmainali5 left a reply on Two Forms In One Page • 4 months ago

@zainudinnoori The form is not redirecting to the controller. I am getting page not found error after submitting the from.

27th January, 2018

anandmainali5 left a reply on Two Forms In One Page • 4 months ago

@zainudinnoori I still have the problem?? When i submit the form nothing is returning? But i am returning all() the values from the form in my controller?

anandmainali5 left a reply on Two Forms In One Page • 4 months ago

@Snapey

//Form 1

"

                                    <div class="form-group">
                                        {!! Form::label('uname','Username')!!}
                                        {!! Form::text('uname',null,['class'=>'form-control'])!!}
                                    </div>

                                    <div class="form-group">
                                        {!! Form::label('email','Email')!!}
                                        {!! Form::email('email',null,['class'=>'form-control'])!!}
                                    </div>

                                    <div class="form-group">
                                        {!! Form::label('image','Photo')!!}
                                        {!! Form::file('image',['class'=>'form-control'])!!}
                                    </div>                               
                            
                                    <div class="form-group">                        
                                        {!! Form::submit('Update User',['class'=>'btn btn-primary pull-right'])!!}
                                    </div>
                            
                            </form>"

//Form 2

" {!! Form::label('oldPassword','Old Password')!!} {!! Form::password('oldPassword',['class'=>'form-control'])!!}

                                    <div class="form-group">
                                        {!! Form::label('newPassword','New Password')!!}
                                        {!! Form::password('newPassword',['class'=>'form-control'])!!}
                                    </div>

                                    <div class="form-group">
                                        {!! Form::label('confirmPassword','Confirm Password')!!}
                                        {!! Form::password('confirmPassword',['class'=>'form-control'])!!}
                                    </div>

                                    <div class="form-group">                        
                                        {!! Form::submit('Update Password',['class'=>'btn btn-primary pull-right'])!!}
                                    </div>
"

anandmainali5 left a reply on Need Help In Coverting Html Code To Text • 4 months ago

@Snapey So how to avoid XSS vulnerabilities??

anandmainali5 left a reply on Unable To Access Methods On User Model Using Auth::user() • 4 months ago

I am also having the same issue? Didn't find the way to solve?

anandmainali5 left a reply on Two Forms In One Page • 4 months ago

@Snapey I have changed the Form library?? Now can you help me out?

//Form 1

                                    <div class="form-group">
                                        {!! Form::label('uname','Username')!!}
                                        {!! Form::text('uname',null,['class'=>'form-control'])!!}
                                    </div>

                                    <div class="form-group">
                                        {!! Form::label('email','Email')!!}
                                        {!! Form::email('email',null,['class'=>'form-control'])!!}
                                    </div>

                                    <div class="form-group">
                                        {!! Form::label('image','Photo')!!}
                                        {!! Form::file('image',['class'=>'form-control'])!!}
                                    </div>                               
                            
                                    <div class="form-group">                        
                                        {!! Form::submit('Update User',['class'=>'btn btn-primary pull-right'])!!}
                                    </div>
                            
                            </form>

//Form 2

{!! Form::label('oldPassword','Old Password')!!} {!! Form::password('oldPassword',['class'=>'form-control'])!!}
                                    <div class="form-group">
                                        {!! Form::label('newPassword','New Password')!!}
                                        {!! Form::password('newPassword',['class'=>'form-control'])!!}
                                    </div>

                                    <div class="form-group">
                                        {!! Form::label('confirmPassword','Confirm Password')!!}
                                        {!! Form::password('confirmPassword',['class'=>'form-control'])!!}
                                    </div>

                                    <div class="form-group">                        
                                        {!! Form::submit('Update Password',['class'=>'btn btn-primary pull-right'])!!}
                                    </div>
                            
                            </form>

anandmainali5 left a reply on Need Help In Coverting Html Code To Text • 4 months ago

@Snapey Why it is dangerous? I am doing like this? Is it good or not? And what is the best method?

{!!html_entity_decode($disorder->about)!!}

anandmainali5 started a new conversation Two Forms In One Page • 4 months ago

I want to update users data from two forms.. How to update it?? I am also getting error in when i submit the form. The routes is not going to the controller. So it is giving me page not fount error.

// Route

Route::post('/admin/updateUser/{$id}', '[email protected]')->name('updateUser'); Route::post('/admin/updatePassword/{$id}', '[email protected]')->name('updatePassword');

//Controller

public function updateUser(Request $request,$id){ return $request->all(); }

public function updatePassword(Request $request,$id){
    return $request->all();
}

//Form 1

{!! Form::model(Auth::user(),['method'=>'PATCH','action'=>['[email protected]',Auth::user()->id],'files'=>true])!!}

                                    <div class="form-group">
                                        {!! Form::label('uname','Username')!!}
                                        {!! Form::text('uname',null,['class'=>'form-control'])!!}
                                    </div>

                                    <div class="form-group">
                                        {!! Form::label('email','Email')!!}
                                        {!! Form::email('email',null,['class'=>'form-control'])!!}
                                    </div>

                                    <div class="form-group">
                                        {!! Form::label('image','Photo')!!}
                                        {!! Form::file('image',['class'=>'form-control'])!!}
                                    </div>                               
                            
                                    <div class="form-group">                        
                                        {!! Form::submit('Update User',['class'=>'btn btn-primary pull-right'])!!}
                                    </div>
                            
                            
                            {!! Form::close()!!}

//Form 2

{!! Form::open(['method'=>'POST','action'=>['[email protected]',Auth::user()->id]])!!}

                                    <div class="form-group">
                                        {!! Form::label('oldPassword','Old Password')!!}
                                        {!! Form::password('oldPassword',['class'=>'form-control'])!!}
                                    </div>

                                    <div class="form-group">
                                        {!! Form::label('newPassword','New Password')!!}
                                        {!! Form::password('newPassword',['class'=>'form-control'])!!}
                                    </div>

                                    <div class="form-group">
                                        {!! Form::label('confirmPassword','Confirm Password')!!}
                                        {!! Form::password('confirmPassword',['class'=>'form-control'])!!}
                                    </div>

                                    <div class="form-group">                        
                                        {!! Form::submit('Update Password',['class'=>'btn btn-primary pull-right'])!!}
                                    </div>
                            
                            
                            {!! Form::close()!!}

anandmainali5 left a reply on Can't Update A Form Leaving The Password Field Empty • 4 months ago

@Snapey Oh sorry i didn't notice the filled(). And finally thanks. It works perfectly..

anandmainali5 left a reply on Can't Update A Form Leaving The Password Field Empty • 4 months ago

@shez1983 i have tried many times but can't solve it.. Will you help me by editing the above code correctly so that works??

anandmainali5 started a new conversation Need Help In Coverting Html Code To Text • 4 months ago

How to convert this code to text with these properties while displaying?

Osteoarthritis (OA)

anandmainali5 left a reply on Send Password Reset Link In Users Gmail • 4 months ago

@bashy It is a production environment?? can you give idea on both environment?? Any mailserver which is free of cost?

26th January, 2018

anandmainali5 left a reply on Can't Update A Form Leaving The Password Field Empty • 4 months ago

yeah its not working so how to fix it.. So that i can leave the password field empty with old password

anandmainali5 left a reply on Can't Update A Form Leaving The Password Field Empty • 4 months ago

I have this function to update the password but if i leave the password field empty then the password is updated to empty. i want the old password if it is left empty.

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

    //
    $user = User::findOrFail($id);
    $this->validate($request, [
        'uname' => 'required|min:3|max:25',
        'email' => ['required','email',
                    Rule::unique('users')->ignore($id),],
        'utype' => 'required',
        'status' => 'required',
        'image' => 'mimes:jpeg,png,gif,bmp,tiff',
        'password' => '',
        'cpass' => 'same:password',

    ]);
    $data = [
        'uname' => $request->uname,
        'email' => $request->email,
        'status' => $request->status,
        'utype' => $request->utype,
        
    ];
    if($request->hasfile('image')){
        $file = $request->image;
        $name = time() . $file->getClientOriginalName();
        unlink(public_path().$user->image);
        $file->move('UserImage',$name);
        $data['image'] = $name;
    }    
    if ($request->has('password')) $data['password'] = bcrypt($request->input('password'));    
    
    $user->update($data);


    return redirect()->route('user.index')->with('success','User successfully updated.');
}

anandmainali5 started a new conversation Can't Update A Form Leaving The Password Field Empty • 4 months ago

Want to update the password if the password is given otherwise leave the old password? How to do it?

anandmainali5 left a reply on Send Password Reset Link In Users Gmail • 4 months ago

don't i need to configure the .env file for mail

anandmainali5 started a new conversation Send Password Reset Link In Users Gmail • 4 months ago

How do i send a password reset link in users gmail account?

25th January, 2018

anandmainali5 left a reply on Automatically Logout Of Dashboard • 4 months ago

no after i refresh the page then it redirects to login page

anandmainali5 started a new conversation Automatically Logout Of Dashboard • 4 months ago

//User class

public function isAdmin(){

    if($this->status == '1'){

        return true;

    }

    return false;

}

//Admin Middleware

public function handle($request, Closure $next)

{
    if(Auth::check()){

        if(Auth::user()->isAdmin()){

            return $next($request);

        }

    }

    return redirect()->route('login');


}

}

Why my isAdmin() is not accessible in admin middleware?? And when i login to the dashboard it automatically redirects to the login page after few seconds? The problem is in the middleware. How to solve it?

anandmainali5 started a new conversation Automatically Logouts After Few Seconds • 4 months ago

//User class

public function isAdmin(){ if($this->status == '1'){ return true; } return false; }

//Admin Middleware

public function handle($request, Closure $next) { if(Auth::check()){ if(Auth::user()->isAdmin()){ return $next($request); } } return redirect()->route('login');

}

}

Why my isAdmin() is not accessible in admin middleware?? And when i login to the dashboard it automatically redirects to the login page after few seconds? The problem is in the middleware. How to solve it?

anandmainali5 started a new conversation Can't Get Current User Data • 4 months ago

How to get current user data in master view??

anandmainali5 started a new conversation WISIWYG Editor • 4 months ago

How to add font size in Quill editor and also how to get data from the textarea form??

//Textarea

{!! Form::label('about','Description')!!}

//Javascipt code for Editor

var quill = new Quill('#editor', { modules: { toolbar: [ [{ 'font': [] }], [{ header: [1, 2, 3, false] }], ['bold', 'italic', 'underline'], ['image', 'code-block'], [{ 'align': [] }], ] }, placeholder: 'Compose an epic...', theme: 'snow' // or 'bubble' });

24th January, 2018

anandmainali5 started a new conversation WISIWYG Editor • 4 months ago

Is there any good WISIWIG Editor that i can use for my website for free?

anandmainali5 started a new conversation Validating Email While Updating With Unique • 4 months ago

How to validate a email with unique while updating? When i update the form without updating the email it shows email already exist? How to solve this?

15th January, 2018

anandmainali5 left a reply on View Not Working • 5 months ago

  • User status
  • //Route Route::resource('adminDashboard', 'AdminDashboardController');

    //Controller

    public function index() {

       return view('adminDashboard.admin_usersStatus');
        
    }
    

    this works fine.

    Edit Your Profile
    Update

    Want to change your profile photo? We pull from gravatar.com.