sadok

sadok

Member Since 1 Year Ago

Experience Points 250
Experience Level 1

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

27 May
1 year ago

sadok left a reply on Class 'App\Http\Controllers\Storage' Not Found

@rin4ik that's true , i didn't notice that you changed the order. thank you very much, and thanks for all members for helping me and giving me many new informations that i can use in the future.

sadok left a reply on Class 'App\Http\Controllers\Storage' Not Found

@rin4ik the problem is that Storage can't be found witch is not logic , that's so weird, it's driving me crazy

sadok left a reply on Class 'App\Http\Controllers\Storage' Not Found

in postman i can see it returning the team id that i want to delete , but it doesn't get deleted

sadok left a reply on Class 'App\Http\Controllers\Storage' Not Found

  public function destroy($id)
  {
    dd($id);
    $team=Team::findOrFail($id);
    $team->delete();
    \Storage::delete($team->logo);
    return response()->json(['data' => $team],200);
  }

sadok left a reply on Class 'App\Http\Controllers\Storage' Not Found

it returns the team s id

sadok left a reply on Class 'App\Http\Controllers\Storage' Not Found

no i checked my data base and the team still exists

sadok left a reply on Class 'App\Http\Controllers\Storage' Not Found

yes i tried that still the same issue and i ve allready run the cmd php artisan storage:link and nothing of these tries solved my issue

sadok left a reply on Class 'App\Http\Controllers\Storage' Not Found

i did try " use Storage " and it still returning 404 :(

sadok left a reply on Class 'App\Http\Controllers\Storage' Not Found

now it's returning 404

sadok started a new conversation Class 'App\Http\Controllers\Storage' Not Found

<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Http\UploadedFile;
use App\User;
use App\Team;
use App\Club;

class TeamController extends Controller
{

public function destroy($id)
  {
    $team=Team::findOrFail($id);
    $team->delete();
    Storage::delete($team->logo);
    return response()->json(['data' => $team],200);
  }
}
26 May
1 year ago

sadok started a new conversation .

.

14 Mar
1 year ago

sadok left a reply on Eloquent Relationships

thnx this was really helpful

13 Mar
1 year ago

sadok started a new conversation Eloquent Relationships

i'm receiving this error when i do the php artisan migrate command, Illuminate\Database\QueryException : SQLSTATE[HY000]: General error: 1005 Can't create table abab.#sql-13ac_dc (errno: 150 "Foreign key constraint is incorrectly formed") (SQL: alter table users add constraint users_match_id_foreign foreign key (match_id) references matches (id))

class CreateMatchesTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('matches', function (Blueprint $table) { $table->increments('id')->unsigned()->unique(); $table->integer('user_id')->unsigned()->unique(); $table->timestamps(); $table->DateTime('game_date'); $table->string('stadium'); $table->string('competition'); }); Schema::table('matches', function (Blueprint $table) { $table->foreign('user_id')->references('id')->on('users'); }); }

/**
 * Reverse the migrations.
 *
 * @return void
 */
public function down()
{
    Schema::dropIfExists('matches');
    /*Schema::table('matches', function(Blueprint $table)
    {
      $table->dropForeign('matches_user_id_foreign');
      $table->dropColumn('user_id');
    });*/
}

}

class CreateUsersTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('users', function (Blueprint $table) { $table->increments('id')->unsigned()->unique(); $table->integer('match_id')->unsigned()->unique(); $table->string('name'); $table->string('email')->unique(); $table->string('password')->bcrypt('secret'); $table->string('gender'); $table->DateTime('birthday'); $table->rememberToken(); $table->timestamps(); }); Schema::table('users', function (Blueprint $table) { $table->foreign('match_id')->references('id')->on('matches'); }); }

/**
 * Reverse the migrations.
 *
 * @return void
 */
public function down()
{
    Schema::dropIfExists('users');
    /*Schema::table('users', function(Blueprint $table)
    {
      $table->dropForeign('users_match_id_foreign');
      $table->dropColumn('match_id');
    });*/
}

}

Models: class User extends Authenticatable { use Notifiable;

protected $fillable = [
    'match_id', 'name', 'email', 'password','gender','birthday',
];

public function matches(){
  return $this.hasMany('App\Match','match_id'); // ou bien $this->hasMany(Match::class);
}

protected $hidden = [
    'password', 'remember_token',
];

}

class Match extends Model { use Notifiable;

    protected $fillable = [
        'user_id', 'game_date', 'stadium', 'competition'
    ];

    public function user(){
      return $this->belongsTo('App\User','user_id');
    }

    protected $hidden = [
       'remember_token',
    ];

}

any help plz