-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new file: app/Http/Controllers/RegisterController.php
modified: app/Http/Controllers/UserController.php modified: app/Http/Kernel.php new file: app/Http/Middleware/HandleInertiaRequests.php new file: app/Http/Requests/BlogCreateRequest.php modified: app/Http/Requests/UserDetailsRequest.php new file: app/Http/Requests/UserLoginRequest.php new file: app/Models/Blog.php modified: composer.json modified: composer.lock new file: database/migrations/2023_11_20_215425_blog-migration-file.php new file: package-lock.json modified: package.json new file: postcss.config.js modified: resources/css/app.css new file: resources/js/Pages/Dashboard.jsx new file: resources/js/Pages/Login.jsx new file: resources/js/Pages/Register.jsx deleted: resources/js/app.js new file: resources/js/app.jsx new file: resources/js/components/FormGroup.jsx new file: resources/views/app.blade.php new file: resources/views/blog.blade.php modified: resources/views/welcome.blade.php modified: routes/web.php new file: tailwind.config.js modified: vite.config.js
- Loading branch information
Showing
27 changed files
with
2,993 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers; | ||
|
||
use Inertia\Inertia; | ||
use Illuminate\Http\Request; | ||
use App\Http\Controllers\Controller; | ||
|
||
class RegisterController extends Controller | ||
{ | ||
public function show(Request $request) { | ||
return Inertia::render('Register'); | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
namespace App\Http\Middleware; | ||
|
||
use Illuminate\Http\Request; | ||
use Inertia\Middleware; | ||
|
||
class HandleInertiaRequests extends Middleware | ||
{ | ||
/** | ||
* The root template that's loaded on the first page visit. | ||
* | ||
* @see https://inertiajs.com/server-side-setup#root-template | ||
* @var string | ||
*/ | ||
protected $rootView = 'app'; | ||
|
||
/** | ||
* Determines the current asset version. | ||
* | ||
* @see https://inertiajs.com/asset-versioning | ||
* @param \Illuminate\Http\Request $request | ||
* @return string|null | ||
*/ | ||
public function version(Request $request): ?string | ||
{ | ||
return parent::version($request); | ||
} | ||
|
||
/** | ||
* Defines the props that are shared by default. | ||
* | ||
* @see https://inertiajs.com/shared-data | ||
* @param \Illuminate\Http\Request $request | ||
* @return array | ||
*/ | ||
public function share(Request $request): array | ||
{ | ||
return array_merge(parent::share($request), [ | ||
// | ||
]); | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
namespace App\Http\Requests; | ||
|
||
use Illuminate\Foundation\Http\FormRequest; | ||
|
||
class BlogCreateRequest extends FormRequest | ||
{ | ||
/** | ||
* Determine if the user is authorized to make this request. | ||
*/ | ||
public function authorize(): bool | ||
{ | ||
return true; | ||
} | ||
|
||
/** | ||
* Get the validation rules that apply to the request. | ||
* | ||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string> | ||
*/ | ||
public function rules(): array | ||
{ | ||
return [ | ||
'title' => ['required', 'string', 'max:255'], | ||
'article' => ['required', 'string', 'max:5000'], | ||
'email' => ['required', 'email:rfc,dns', 'exists:users,email'] | ||
]; | ||
} | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace App\Http\Requests; | ||
|
||
use Illuminate\Foundation\Http\FormRequest; | ||
|
||
class UserLoginRequest extends FormRequest | ||
{ | ||
/** | ||
* Determine if the user is authorized to make this request. | ||
*/ | ||
public function authorize(): bool | ||
{ | ||
return true; | ||
} | ||
|
||
/** | ||
* Get the validation rules that apply to the request. | ||
* | ||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string> | ||
*/ | ||
public function rules(): array | ||
{ | ||
return [ | ||
"email" => ['required', 'email:rfc,dns', 'exists:users,email'], | ||
"password" => ['required', 'min:6', 'max:12', ''] | ||
]; | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace App\Models; | ||
|
||
use Illuminate\Database\Eloquent\Factories\HasFactory; | ||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class Blog extends Model | ||
{ | ||
use HasFactory; | ||
|
||
protected $guarded = []; | ||
} |
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
database/migrations/2023_11_20_215425_blog-migration-file.php
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
*/ | ||
public function up(): void | ||
{ | ||
Schema::create('blogs', function (Blueprint $table) { | ||
$table->id(); | ||
$table->string('title'); | ||
$table->longText('article'); | ||
$table->foreignId('user_id')->constrained(); | ||
$table->timestamps(); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
*/ | ||
public function down(): void | ||
{ | ||
Schema::dropIfExists('blogs'); | ||
} | ||
}; |
Oops, something went wrong.