This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Http\Requests; | |
| use Illuminate\Foundation\Http\FormRequest; | |
| class UpdateProfilePicture extends FormRequest | |
| { | |
| /** | |
| * Determine if the user is authorized to make this request. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Http\Controllers; | |
| use Illuminate\Http\Request; | |
| // requests | |
| use App\Http\Requests\UpdateProfilePicture; | |
| // models |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Route::post('update_profile_picture', 'ProfileController@updateProfilePicture')->name('profile.update.picture'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <form action="{{ route('profile.update.picture') }}"> | |
| <div style="overflow-x: hidden;border: 1px solid #f1f1f1; margin: 5px 0px 3px 0px;"> | |
| <input type="file" name="profile-picture" class="btn btn-xs"> | |
| </div> | |
| <button type="submit" class="btn btn-primary btn-xs">Actualizar</button> | |
| </form> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| use Illuminate\Database\Seeder; | |
| class UsersTableSeeder extends Seeder | |
| { | |
| /** | |
| * Run the database seeds. | |
| * | |
| * @return void |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| ... | |
| class User extends Authenticatable | |
| { | |
| ... | |
| /** | |
| * Helper methods | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @extends('layouts.app') | |
| @section('content') | |
| <div class="container"> | |
| <div class="row"> | |
| <div class="col-md-8 col-md-offset-2"> | |
| <div class="panel panel-default"> | |
| <div class="panel-body"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| .... | |
| class CreateLikesTable extends Migration | |
| { | |
| public function up() | |
| { | |
| Schema::create('likes', function (Blueprint $table) { | |
| $table->increments('id'); | |
| $table->integer('user_id')->unsigned(); | |
| $table->foreign('user_id')->references('id')->on('users')->onUpdate('cascade')->onDelete('cascade'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| ... | |
| class CreateCommentsTable extends Migration | |
| { | |
| public function up() | |
| { | |
| Schema::create('comments', function (Blueprint $table) { | |
| $table->increments('id'); | |
| $table->integer('user_id')->unsigned(); | |
| $table->integer('user_id')->references('id')->on('posts')->onUpdate('cascade')->onDelete('cascade'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| ... | |
| class CreatePostsTable extends Migration | |
| { | |
| public function up() | |
| { | |
| Schema::create('posts', function (Blueprint $table) { | |
| $table->increments('id')->unsigned(); | |
| $table->integer('user_id')->unsigned(); |