enexspecial

Experience

1,250

0 Best Reply Awards

  • Member Since 2 Months Ago
  • 1 Lesson Completed
  • 0 Favorites

16th November, 2017

enexspecial left a reply on Please I Am Getting This Error [BadMethodCallException] • 5 days ago

message: "Call to undefined method App\User::profiles()", exception: "BadMethodCallException"

The same error

enexspecial left a reply on Please I Am Getting This Error [BadMethodCallException] • 5 days ago

Yes i Have changed it to

orWhereHas('profiles', function($asking) i still the same error. Please How do i solve the problem?

enexspecial started a new conversation Please I Am Getting This Error [BadMethodCallException] • 5 days ago

Please I am trying to create a search using jquery autocomplete ui and i am getting this error message : message: "Call to undefined method App\User::App\profiles()", exception: "BadMethodCallException" Here is my controller

public function SearchFriends(Request $request) { $term = $request->term; $searching = User::where('email', 'LIKE', '%'. $term . '%') ->orWhere('location', 'LIKE', '%'.$term.'%') ->orWhere('name', 'LIKE', '%'.$term.'%') ->orWhereHas('App\profiles', function($asking) use ($term){ $asking->where('community', 'LIKE', '%'.$term.'%') ->orWhere('ethnicity', 'LIKE', '%'.$term.'%') ->orWhere('state', 'LIKE', '%'.$term.'%'); })->orderBy('id')->paginate(20); $data = []; foreach($searching as $key => $value){ $data[] = [ 'id' => $value->id, 'email' => $value->email, 'location' => $value->location, 'name' => $value->name, 'community' => $value->community, 'ethnicity' => $value->ethnicity, ]; } return response()->Json($data); }

Here is my Jquery code:

$(document).ready(function(){ $('input[name="keywords"]').autocomplete({ source : "{!!url('/keysearch')!!}", autoFocus : true, minLength : 1, select:function(key, value){ console.log(value); } }); });

Here is my model for Profiles: namespace App;

use Illuminate\Database\Eloquent\Model; use App\User;

class profiles extends Model { protected $fillable = [ 'user_id', 'address', 'ethnicity', 'state', 'community', 'age' ]; public function user() { return $this->belongsTo(User::class); } }

Here is my model for user:

public function Profiles() { return $this->hasOne(profiles::class); }

Please help is need on how to solve it: Thank you

14th November, 2017

enexspecial started a new conversation Please I Want Help On How To Solve This Issue • 1 week ago

I trying to create a system where a user can click on an image then a modal open and user can view the picture and also read the comment of other users; Now i have this routes:

Route::get('/upload','[email protected]')->name('upload');==> This render the page

Route::post('/picture', '[email protected]'); ==> This is button that upload the picture file to serve and it is a bootstrap modal.

Route::get('upload/show/{id}', '[email protected]');==> This is modal that display the image file and the comment edit and delete

The error here is this (Undefined variable: albums)

Here is the controller:

public function index() { $photos = DB::table('upload_galleries')->get();

  return view('community.gallery', compact('photos'));
}

public function showUpload($id) {

  $albums = DB::table('upload_galleries')->where('id', $id)->first();

  return view('community.gallery.upload', compact('albums'));
}

Here is my view:

Gallery Picture ×

Picture Upload

{{Form::open(['file'=>true,'url'=>'/picture', 'method'=>'post', 'enctype'=>'multipart/form-data'])}} {{csrf_field()}} {{Form::label('details','Details')}} {{Form::textarea('details','',['class'=>'form-control input-sm', 'rows'=>'2'])}} {{Form::label('upload','Upload Picture')}} {{Form::file('picture',['class'=>'form-control input-sm', 'rows'=>'3'])}} Upload
                    {{Form::close()}}
                  </div>
                  <div class="modal-footer">
                        <button type="button" class="btn btn-default btn-sm" data-dismiss="modal">Close</button>
                  </div>
                </div>
              </div>
            </div>
      

@foreach($photos as $photo) @endforeach ×

{{strtoupper(Auth::user()->slug)}} Picture

@foreach($albums as $album) {{$album->details}} {{Form::open()}} {{Form::textarea('comment','',['class'=>'form-control input-sm', 'rows'=>2])}} &nbsp| &nbsp| {{Form::close()}} @endforeach

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

</div>

enexspecial left a reply on How Can I Solve This 404 Not Found Error Even When Route Exist • 1 week ago

Please i Need Help !!!!!!!!!!!!!!!!!!!!!!!!!

13th November, 2017

enexspecial left a reply on How Can I Solve This 404 Not Found Error Even When Route Exist • 1 week ago

@Snapey : I have manually entered the lat and long value into the database i want to retrieve the data from the database. Please what is the best way to go about it

@rumm.an : I have tried it and i am getting 500 internal server error and also i tried using api route and i am getting 401 (Unauthorized)

enexspecial left a reply on How Can I Solve This 404 Not Found Error Even When Route Exist • 1 week ago

Yes i have my debugger turned on here is the error

http://127.0.0.1:8000/%7B%7Broute('mappy')%7D%7D 404 (Not Found)

and i have done the php artisan route:list

Here is the result;

POST | mappy | location | App\Http\Cont rollers\[email protected] | web,auth

enexspecial left a reply on How Can I Solve This 404 Not Found Error Even When Route Exist • 1 week ago

I did do the php artisan route:list and the route exist.

enexspecial left a reply on How Can I Solve This 404 Not Found Error Even When Route Exist • 1 week ago

I have changed it to Route::any('/mappy','[email protected]')->name('location'); i still have the error

enexspecial left a reply on How Can I Solve This 404 Not Found Error Even When Route Exist • 1 week ago

Okay Here is my route: Route::post('/mappy','[email protected]')->name('location');

Here is my controller: public function postLocation(Request $request) { $lat = $request->lat; $long = $request->lng;

    $map = Mappy::whereBetween('lat', [$lat-0.1,$lat+0.1])->whereBetween('long', [$long-0.1,$long+0.1])->get();

    return $map;
}

Here is my Js file: function searchInformation(lat,long) { $.post("{{URL::to('mappy')}}", {lat:lat, long:long}, function(match){ console.log(match); }); }

12th November, 2017

enexspecial started a new conversation How Can I Solve This 404 Not Found Error Even When Route Exist • 1 week ago

I have being trying to solve this issue about this 404 not found error i created a route and it keep giving me this error

8th November, 2017

enexspecial left a reply on Please I Need Help To Solving This Error Code 404 Not Found • 1 week ago

Okay i have remove the get() but i still have the same error; please what could i have being doing wrong

enexspecial started a new conversation Please I Need Help To Solving This Error Code 404 Not Found • 1 week ago

I am trying to create a search within two database table and am using jquery autocomplete, after writing the code i got this error 404 not found. Please i need help solving the issue. Here is my Jquery: $(document).ready(function(){ $('input[name="keywords"]').autocomplete({ source : "{{URL::to('/findsFriends')}}", autoFocus : true, select : function(key value){ console.log(value); } }); });

Here is my controller: public function postSearchRequest(Request $request) { $search = $request->term; $keyword = User::where('email', 'LIKE', '%'. $search . '%')

                    ->orWhere('location', 'LIKE', '%'.$search.'%')

                    ->orWhere('fullname', 'LIKE', '%'.$search.'%')

                    ->orWhereHas('profiles', function($asking) use ($search){

                      $asking->where('community', 'LIKE', '%'.$search.'%')

                              ->orWhere('ethnicity', 'LIKE', '%'.$search.'%')

                              ->orWhere('state', 'LIKE', '%'.$search.'%');

                    })->orderBy('id')->paginate(20)->get();
      $data = [];

      foreach($keyword as $key => $value){

          $data[] = [ 'id'        => $value->id,

                         'email'     => $value->email,

                      'location'  => $value->location,

                      'fullname'  => $value->fullname,

                      'community' => $value->community,

                      'ethnicity' => $value->ethnicity,
                    ];
      }
      return response()->Json($data);
}

7th November, 2017

enexspecial started a new conversation Please How Can I Solve This Error 404 Not Found • 2 weeks ago

I am trying to create a search engine that will search my database for users, i have written my code and am trying console.log my code and am getting this error 404 not found. Here is Jquery Code; $(document).ready(function(){ $('input[name="keywords"]').autocomplete({ source : "{{URL::to('/findFriends')}}", autoFocus : true, select:function(key, value){ console.log(value); }

});

}); Here is my controller code: public function postSearchRequest(Request $request) { $search = $request->term; $keyword = User::where('email', 'LIKE', '%'. $search . '%') ->orWhere('location', 'LIKE', '%'.$search.'%') ->orWhere('fullname', 'LIKE', '%'.$search.'%') ->orWhereHas('profiles', function($asking) use ($search){ $asking->where('community', 'LIKE', '%'.$search.'%') ->orWhere('ethnicity', 'LIKE', '%'.$search.'%') ->orWhere('state', 'LIKE', '%'.$search.'%'); })->orderBy('id')->paginate(20)->get(); $data = []; foreach($keyword as $key => $value){ $data[] = [ 'id' => $value->id, 'email' => $value->email, 'location' => $value->location, 'fullname' => $value->fullname, 'community' => $value->community, 'ethnicity' => $value->ethnicity, ]; } return response()->Json($data); }

enexspecial started a new conversation How Can I Solve This Autocomplete Error: 404 Error • 2 weeks ago

I am trying to create a search engine to search my database am i current encountering this error http://127.0.0.1:8000/%7B%7BURL::to('/findFriends')%7D%7D?term=h 404 (Not Found)

Here is my javascript; $(document).ready(function(){ $('input[name="keywords"]').autocomplete({ source: "{{URL::to('/findFriends')}}", //minLength:2, select:function(key, value){ console.log(value); } }); });

Here is my route: Route::get('/findFriends', '[email protected]');

Here is my controller public function postSearchRequest(Request $request) { $search = $request->term; $keyword = User::where('email', 'LIKE', '%'. $search . '%') ->orWhere('location', 'LIKE', '%'.$search.'%') ->orWhere('fullname', 'LIKE', '%'.$search.'%') ->orWhereHas('profiles', function($asking) use ($search){ $asking->where('community', 'LIKE', '%'.$search.'%') ->orWhere('ethnicity', 'LIKE', '%'.$search.'%') ->orWhere('state', 'LIKE', '%'.$search.'%'); })->orderBy('id')->paginate(20)->get(); $data = []; foreach($keyword as $key => $value){ $data[] = [ 'id' => $value->id, 'email' => $value->email, 'location' => $value->location, 'fullname' => $value->fullname, 'community' => $value->community, 'ethnicity' => $value->ethnicity, ]; } return response($data); }

6th November, 2017

enexspecial started a new conversation How Can Build A Chat Room Application With Laravel • 2 weeks ago

I want to build a chat room application with laravel that involves people around my community, i don't want people from other community to have access.

So in my form i have a field that requested for the community a user is from:

Please i want help to understand what i am going to do here?

31st October, 2017

enexspecial started a new conversation Please How Can I Solve This Error: Page Not Found • 3 weeks ago

Here is my Route: Route::post('/addFriend/(id)', '[email protected]');

Here is my controller:

namespace App\Http\Controllers;

use Illuminate\Http\Request; use DB; use Auth;

class searchController extends Controller { public function __construct() { $this->middleware('auth'); }

public function index()
{
  $uid  = Auth::user()->id;
    $allUsers = DB::table("profiles")->leftJoin("users", "users.id", "=", "profiles.user_id")->where("users.id", "!=", $uid)->get();
  return view('community.search')->with(compact("allUsers"));
}

public function sendFriend($id)
{

  //echo $id;
  return Auth::user()->addFriend($id);
}

}

Here is Friendable File:

?php

namespace App\Traits; use App\Friendship;

trait Friendable {

public function test() { return 'hi'; }

public function addFriend($id) { $friendship = Friendship::create([ 'requester' => $this->id, 'user_requested' => $id, ]); if($frienship){ return $friendship; } return "Failed";

} }

enexspecial left a reply on Hello My Awesome Community Please How Can I Solve This Error Page Not Found: • 3 weeks ago

here is my route Route::post('/addFriend/(id)', '[email protected]');

enexspecial started a new conversation Hello My Awesome Community Please How Can I Solve This Error Page Not Found: • 3 weeks ago

I am trying to create a friend request system here is are my files: public function addFriend($id) { $friendship = Friendship::create([ 'requester' => $this->id, 'user_requested' => $id, ]); if($frienship){ return $friendship; } return "Failed";

}

here is my controller: public function index() { $uid = Auth::user()->id; $allUsers = DB::table("profiles")->leftJoin("users", "users.id", "=", "profiles.user_id")->where("users.id", "!=", $uid)->get(); return view('community.search')->with(compact("allUsers")); }

public function sendFriend($id)
{

  //echo $id;
  return Auth::user()->addFriend($id);
}

here is my blade file:

@foreach($allUsers as $userList)

{{$userList->name}}

Profile Pix

{{$userList->community}}

Add a Friend

@endforeach

26th October, 2017

enexspecial left a reply on How Can I Solve This Error:422 (Unprocessable Entity) • 3 weeks ago

ok i have read the page but and i have added the enctype = "multipart/form-data"

i did a console.log(data.responseJSON.message);

i got this error message [The given data was invalid.] So please explain to me cause i don't understand it anymore

enexspecial left a reply on How Can I Solve This Error:422 (Unprocessable Entity) • 3 weeks ago

Here is the form:

{{Form::Open(['action'=> '[email protected]', 'id'=>'dis-form' ,'method'=>'post','files'=>true])}}
                  <div class="form-group">
                    {{Form::label('interest', 'Topic of Interest',['class'=>'control-label'])}}
                    <div class="">
                      {{Form::select('interest_id',$interest,null,['id'=>'interest_id', 'class'=>'form-control'])}}
                    </div>
                  </div>
                  <div class="form-group">
                    {{Form::label('title', 'Give a Title',['class'=>'control-label'])}}
                    <div class="">
                        {{Form::text('title','',['class'=>'form-control input-sm', 'id'=>'title'])}}
                    </div>
                  </div>
                  <div class="form-group">
                    {{Form::label('picturevideo', 'Upload',['class'=>'control-label'])}}
                    <div class="">
                      <input type="file" name="picturevideo" id="picturevideo" class="form-control input-sm">
                    </div>

                  </div>

                  <div class="form-group">
                    {{Form::label('body', 'Let\'s Talk',['class'=>'control-label'])}}
                    <div class="">
                        {{Form::textarea('body','',['id'=>'body','class'=>'form-control input-sm', 'rows' => '10'])}}
                    </div>
                  </div>
                  <button type="submit" class="btn btn-primary">Start Discussion</button>
                {{Form::Close()}}

25th October, 2017

enexspecial started a new conversation How Can I Solve This Error:422 (Unprocessable Entity) • 3 weeks ago

Here is my javascript code:

$("#dis-form").on("submit", function(e){ e.preventDefault(); var token = $('input[name=token]').val(); var interest_id = $('#interest_id').val(); var title = $('#title').val(); var picturevideo = $('#picturevideo').val(); var body = $('#body').val(); var url = $(this).attr('action'); var post = $(this).attr('method');

$.ajax({
      type     : post,
      url      : url,
      data     : {'token':token,'interest_id':interest_id,'title':title,'picturevideo':picturevideo,'body':body },
      contentType : "application/json",
      success: function(data){
        console.log(data);
      },
      error: function(data){
        console.log(data);
      }
});

}); Here is my controller public function postDiscuss(Request $request) { $this->validate($request, [ 'interest' =>'required', 'title' => 'required', 'picturevideo' => 'required|mimes:jpg,jpeg,gif,mp4,mpeg,avi|max:5000000', 'body' => 'required' ]);

  if($request->ajax())
  {
    $discuss = new Discuss();
    $dicuss->user_id = Auth::user()->id;
    $discuss['interest_id'] = $request['interest_id'];
    $discuss['title'] = $request->title;
    if(Input::hasFile('picturevideo')){
      $file             = Input::file('picturevideo');
      $allowedfileTypes = config('app.allowedfileTypes');
      $filename         = $file->getClientOrginalName();
      $destinationPath  = config('app.fileDestinationPath').'/'.$filename;
      $uploded          = Storage::put($destinationPath, file_get_contents($file->getRealPath()));
      if($uploaded){
        $discuss['picturevideo'] = $request->$filename;
      }
    }
    $discuss['body'] = $request->body;
    if($discuss->save()){
        return response($discuss);
    }
  }
}

Please how can i solve this issues

15th October, 2017

enexspecial started a new conversation How Can I Solve This Error Message: Creating Default Object From Empty Value • 1 month ago

Here is my controller:

14th October, 2017

enexspecial started a new conversation Can I Use Vue Js And Laravel Together? • 1 month ago

I am having taught on using laravel and vue js together will it work and if yes how ?

enexspecial left a reply on How Can I Solve This Issue : Undefined Variable: Inter • 1 month ago

Hi @ tisuchi i have still the same error

enexspecial started a new conversation How Can I Solve This Issue : Undefined Variable: Inter • 1 month ago

Here is my HTML FILE

{{Form::label('interest', 'Topic of Interest',['class'=>'control-label'])}} {!!Form::select('interest_id',$inter,null, ['id'=>'interest_id', 'class'=>'form-control'])!!}

Here is my Route: Route::get('/campaign', [ 'uses' => '[email protected]', 'as' => 'community.campaign' ]);

Route::post('/discuss', [ 'uses'=>'[email protected]', 'as' => 'community.campaign' ]);

Here is my Controller: namespace App\Http\Controllers;

use Illuminate\Http\Request; use Validator; use Auth; use App\interest; use App\Discuss;

class discussController extends Controller {

public function __construct()
{
  $this->middleware('auth');
}

public function getCampaign()
{
  return view('community.campaign', ['inter'=>interest::pluck('interest_name', 'id')]);
}

10th October, 2017

enexspecial started a new conversation Class 'App\Http\Controllers\Auth\Role' Not Found • 1 month ago

I want to create a default role for users on registeration

Here is my controller:

4th October, 2017

enexspecial started a new conversation Please Help Me Solve This Error: [Creating Default Object From Empty Value] • 1 month ago

I am trying to create a profile page that includes adding of image and i got this error [Creating default object from empty value].

Here is my migration file: public function up() { Schema::create('profiles', function (Blueprint $table) { $table->increments('id'); $table->integer('user_id'); $table->string('photo'); $table->string('address'); $table->string('ethnicity'); $table->string('state'); $table->timestamps(); }); }

Here is my controller public function store(Request $request) { //validate form $this->validate($request,[ 'photo' => 'required|mimes:jpg,png,jpeg,bmp', 'address' => 'required|max:191', 'ethnic' => 'required|min:3', 'state' => 'required', ]); Session(); $user = new User; $profiles = new profile; $profiles->photo = $request->input('photo'); $profiles->address = $request->input('address'); $profiles->ethnic = $request->input('ethnic'); $profiles->state = $request->input('state'); $profile->user_id = auth()->user()->id; return auth()->user()->id; exit(); } Here is my form:

{{csrf_field()}} Fullname My Location Mobile Upload Picture Home Address Ethnicity State of Origin Submit Profile
</div>

3rd October, 2017

enexspecial left a reply on I Cannot Solve This Error Code (Function Must Be A String) • 1 month ago

Thank you very much it helped alot

2nd October, 2017

enexspecial started a new conversation I Cannot Solve This Error Code (Function Must Be A String) • 1 month ago

I tried submitted the data: {{Form::Open()}} Electricity Security Environment Politics infrastructure

            </thead>
            <tbody>
              <td>{{Form::checkbox('electricity','electricity')}}{{Form::label('electricity','Electricity')}}</td>
              <td>{{Form::checkbox('security','security')}}{{Form::label('security','Security')}}</td>
              <td>{{Form::checkbox('environment','environment')}}{{Form::label('environment','Environment')}}</td>
              <td>{{Form::checkbox('politics','politics')}} {{Form::label('politics','Politics')}}</td>
              <td>{{Form::checkbox('infrastructure','Infrastructure')}} {{Form::label('infrastructure','Infrastructure')}}</td>

            </tbody>

            <thead>
              <th>Community Market</th>
              <th>Youth Empowerment</th>
              <th>Skill Acquisition</th>
              <th>Religion</th>

            </thead>
            <tbody>
              <td>{{Form::checkbox('market','market')}} {{Form::label('market','Market')}}</td>
              <td>{{Form::checkbox('youth','youth')}} {{Form::label('youth','Youth')}}</td>
              <td>{{Form::checkbox('skills','skills')}} {{Form::label('skills','Skills')}}</td>
              <td>{{Form::checkbox('religion','religion')}} {{Form::label('religion','Religion')}}</td>
            </tbody>
            <thead>
              <th>Education</th>
              <th>Festival</th>
            </thead>
            <tbody>
              <td>{{Form::checkbox('education','education')}} {{Form::label('education','Education')}}</td>
              <td>{{Form::checkbox('festival','festival')}} {{Form::label('festival','Festival')}}</td>
            </tbody>
        </table>
        {{Form::Submit('SaveInterest',['class' => 'btn btn-primary'])}}
      {{Form::Close()}}

    </div>
  </div>

Here is my controller public function store(Request $request) { //dd($request)->all();

    $electric   = $request("electricity");
    $secure     = $request('security');
    $enivron    = $request('environment');
    $politics   = $request('politics');
    $structure  = $request('infrastructure');
    $market     = $request('market');
    $youth      = $request('youth');
    $skills     = $request('skills');
    $religion   = $request('religion');
    $educate    = $request('education');
    $festival   = $request('festival');

    $interest = new interest;
    $interest->electricity    = $electric;
    $interest->security       = $secure;
    $interest->environment    = $environ;
    $interest->politics       = $politics;
    $interest->infrastructure = $structure;
    $interest->market         = $market;
    $interest->youth          = $youth;
    $interest->skills         = $skills;
    $interest->religion       = $religion;
    $interest->education      = $education;
    $interest->festival       = $festival;

    $interest->save();

    return redirect()->to('/home');

}

I keep getting this error Function name must be a string

Please How can i solve this issue

24th August, 2017

enexspecial left a reply on My Page Is Not Rendering • 2 months ago

Here is home.blade.php

@extends('layout.business') @section('title','ACA::SOLVE')

@section('content')

Business Manager

Sign Out

@endsection

enexspecial left a reply on My Page Is Not Rendering • 2 months ago

Here is my controller

enexspecial left a reply on My Page Is Not Rendering • 2 months ago

Here is my route: Route::get('/pages/user',[ 'uses'=> '[email protected]', 'as' => 'business.pages.user' ]); Here is my controller:

public function getCreateUser(){ return view('business.pages.user'); }

enexspecial started a new conversation My Page Is Not Rendering • 2 months ago

I can't seem to figure out what is wrong with line of code in jquery:

function pageLoad(filename, content){ content = typeof content !== 'undefined' ? content : 'content'; $('.content_loading').show(); $.ajax({ type: "GET", url: filename, contentType:false, success: function(data){ $("#" + content).html(data); $('.content_loading').hide(); }, error: function(xhr, status,error){ alert(xhr.responseText); } }); }

The code is supposed to render the link

Inside this div element

The problem i can't figure out and not error is being displayed browser debugging console on chrome please help is needed

23rd August, 2017

enexspecial left a reply on Navigation Menu Issues • 2 months ago

Thank you all for help i figured it out

22nd August, 2017

enexspecial left a reply on Navigation Menu Issues • 2 months ago

Yes I want the ajax response,

enexspecial left a reply on Navigation Menu Issues • 2 months ago

I have created this navigation menu all i just want is content to load on the same page without refreshing using laravel

enexspecial left a reply on Navigation Menu Issues • 2 months ago

I Seriously have this issue and i want help to grow fast using this technology

enexspecial started a new conversation Navigation Menu Issues • 2 months ago

Please can i get help on how to create a navigation menu that it links can load dynamically ?

Edit Your Profile
Update

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