seyidaniels

seyidaniels

Member Since 1 Year Ago

Experience Points 310
Experience Level 1

4,690 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 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.

18 Jun
1 year ago

seyidaniels left a reply on Eloquent Relationships Not Giving Data Of Relationships

public function saveMock(Request $request) { $mockresult = new MockResult(); $mockresult->score = $request['score']; $mockresult->percentage = $request['percentage']; $mockresult->aggregate = $request['aggregate']; $mockresult->uniqueKey = $request['key']; if ($request->user()->mocks()->save($mockresult)){ return response()->json(['message' => 'Result Saved']); }else { return response()->json(['error' => 'Something happened']); } }

seyidaniels started a new conversation Eloquent Relationships Not Giving Data Of Relationships

I am working on a restful api with jwt auth and created relationship between the User and the Result Model such that the User has many results and the Results belongs to one User.

But on using postman to test the api for the results, i get the Results data with the user id but i do not have the user details which i need on my angular front end please how do i go about this?

The User Model

14 Dec
1 year ago

seyidaniels started a new conversation Trying To Insert Optional Value 'Image' To Server

Hello guys, i am quite new to Laravel and was creating a social media website as practice where users update their status like the facebook thing but the issue am having is that its not every post that should have an image attached to it.

So when ever i send a post without an image it gives me this error:

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'image' cannot be null (SQL: insert into stories (body, image, user_id, updated_at, created_at) values (My anme os Ololade, , 2, 2017-12-14 14:00:08, 2017-12-14 14:00:08))

Which shows that there is no value for the image. However, i updated the migration file and made the image nullable like this: $table->binary('image')->nullable(); It works and image upload becomes optional but on checking my sql database i do not get to see a blob file whenever i upload images as all values under the image column is null.

Please is there a way to override this error laravel gives me? That is: If there is no image, it should go ahead and update status or if i could pass a validation via my controller that the image data is not required.

here is my code:

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

        $table->text('body');
        $table->binary('image')->
        $table->integer('user_id');
        $table->timestamps();

    });
}

//Migrations file

public function createStory(Request $request){ $image = $request['image']; $story = new Story(); $story->body = $request['body']; $story->image = $image; $request->user()->stories()->save($story); return response()->json(['message' => 'Your Story has been posted']); }

//The Function that creates a post

18 Nov
1 year ago

seyidaniels left a reply on Where Are You All From?

Lagos, Nigeria

seyidaniels left a reply on Laravel - How To Validate Sum Of Values To Other Input Value

I guess u should validate this on the client side and not on the server

seyidaniels left a reply on Routing Issue

Your question is not clear perhaps you could be more explanatory...

But one thing i know is.. You can define your routes in a controller function then call it in the web.php

For example

Route.get('/ahome3', [ 'uses' => '[email protected]', 'as' => 'ahome3']

Class SomeController {

function gethome3(){

return redirect()->route(ahome3);

}

}

seyidaniels left a reply on Automatic Ajax Request

You should use a post request instead and check out javascript functions when a page has finished loading.... So u send the ajax request within the function

14 Nov
1 year ago

seyidaniels started a new conversation Cant Change Default Authentication From User Model To Admin Model In Auth.php Config

I am about starting my first official project after learning the basics of Laravel. I do not need a user model in this project so i deleted the default user model and its migration files.

I created my own Admin Model with its migrations file and extended the authenticatable class, also defined my admin controller and did all necessary steps to be done.

But i keep getting this error : SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ulssa_laravel.users' doesn't exist (SQL: select count(*) as aggregate from users where username = haruna99)

I googled stuffs online and tried to configure the auth.php in the config folder to point to my Admin Class Model but yet the authentication is still pointing to the deleted User model and Database.

'providers' => [ 'users' => [ 'driver' => 'eloquent', 'model' => App\Admin::class, ],

13 Nov
1 year ago

seyidaniels left a reply on Blade Template Error Trying To Get Property Of Non-object

Thanks @tykus one of my posts obviosuly did not have a user associated with it so i kinda caused errors, i remember deleting some rows in the database before that error occured. However the optional() function in the blade template didnt work either so all i just did was empty the post table and users table and its working perfectly.. Thanks for the help! Am on Laravel 5.4

12 Nov
1 year ago

seyidaniels started a new conversation Blade Template Error Trying To Get Property Of Non-object

I recently got an error with my dashboard blade template which i didn't edit and i do not seem to understand this error. Although i realized the errors came from the article html tag where am calling the posts variable i passed from my controller class, i do not know how to solve this problem.

@extends('layouts/master')

@section('title') The Dashboard @endsection

@include('includes.header')

@section('content')

The Dashboard

@include('includes.messageblock')

    <div class="col-md-6 col-md-offset-3">
    <form action="{{route('post.create')}}" method="post">
        <p class="lead">Update status</p>
        <div class="form-group">
        <textarea class="form-control" name="body" id="newpost" rows="3" placeholder="What's on your mind?"></textarea>
        </div>
        <button type="submit" class="btn btn-info btn-fill btn-md pull-right">Post!</button>
        <input type="hidden" name="_token" value="{{Session::token()}}">
    </form>
</div>
</div>

What Others are saying

    @foreach($posts as $post)
            <article class="posts" data-id="{{$post->id}}">
                <p id="body">{{$post->body}}</p>
                <div class="info pull-right">Posted by {{$post->user->name}} on {{$post->created_at}}</div>
                <div class="interaction">
                    <a href="#">Like</a>
                    <a href="#">Dislike</a>
                @if(Auth::user() == $post->user)
                    <a href="#" class="edit">Edit</a>
                    <a href="{{route('post.delete',['post_id' => $post->id])}}">Delete</a>
                @endif
                </div>
            </article>
            <div style="margin-top: 15px;"></div>
    @endforeach
</div>

    
    
</div>
×

Edit Post

    <div class="form-group">
        <textarea class="form-control" id="editcontent" name="body" id="newpost" rows="3" ></textarea>
    </div>
    
  </div>
  <div class="modal-footer">
    <button type="button" class="btn btn-default" data-dismiss="modal" >Close</button>
    <button type="button" class="btn btn-primary" id="save">Save changes</button>
  </div>
</div>
var token = "{{Session::token()}}" var url = "{{route('edit')}}"; @endsection

post controller class

public function getDashboard(){
    $posts = Post::orderBy('created_at', 'desc')->get();
    return view('dashboard', ['posts' => $posts]);
}
08 Nov
1 year ago

seyidaniels started a new conversation Authenticate Middleware Not Working

I am a newbie in Laravel, the tutorial am watching i.e Laravel 5.2 has an authenticate class inside the middleware folder, so i decided to create my own Authenticate.php file and added it to my array in the routes/web.app yet the dashboard which am trying to hide its visibility when user is not authenticated is still visible