Skip to content

Commit

Permalink
Merge pull request #2 from Maestro-ESEO/dev
Browse files Browse the repository at this point in the history
First migration, model, controller, route & view
  • Loading branch information
maxencebonamy authored Dec 26, 2023
2 parents 8170dfe + 419d9c8 commit af66c10
Show file tree
Hide file tree
Showing 18 changed files with 155 additions and 327 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Tests

on:
push:
branches:
- main
- dev

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
extensions: mbstring, sqlite3

- name: Install dependencies
run: composer install --no-interaction

- name: Create environment file
run: cp .env.example .env

- name: Generate application key
run: php artisan key:generate

- name: Run tests
run: php artisan test
18 changes: 18 additions & 0 deletions app/Http/Controllers/UserController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Models\User;

class UserController extends Controller
{

public function show()
{
return view('profile', [
'user' => User::all()->first()
]);
}

}
1 change: 0 additions & 1 deletion app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class Kernel extends HttpKernel
],

'api' => [
// \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
\Illuminate\Routing\Middleware\ThrottleRequests::class.':api',
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
Expand Down
13 changes: 5 additions & 8 deletions app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,24 @@

namespace App\Models;

// use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Sanctum\HasApiTokens;

class User extends Authenticatable
{
use HasApiTokens, HasFactory, Notifiable;
use HasFactory;

/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'name',
'first_name',
'last_name',
'email',
'password',
'profile_photo_path'
];

/**
Expand All @@ -29,8 +28,7 @@ class User extends Authenticatable
* @var array<int, string>
*/
protected $hidden = [
'password',
'remember_token',
'password'
];

/**
Expand All @@ -39,7 +37,6 @@ class User extends Authenticatable
* @var array<string, string>
*/
protected $casts = [
'email_verified_at' => 'datetime',
'password' => 'hashed',
];
}
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"php": "^8.1",
"guzzlehttp/guzzle": "^7.2",
"laravel/framework": "^10.10",
"laravel/sanctum": "^3.3",
"laravel/tinker": "^2.8"
},
"require-dev": {
Expand Down
Loading

0 comments on commit af66c10

Please sign in to comment.