Hi! I'm Enes, I have finished the final project with Laravel framework!
- Clone this repository by
git clone https://github.com/teknasyon-bootcamp/enes-dogan-final-project.git
cd enes-dogan-final-project
- Run
composer install
if you don't have composer visit. - Run
cp .env.example .env
.env.example has already database connection credentials for docker container. - Run
docker-compose up
to up mySQL container if you don't have docker visit. - Run
php artisan migrate:fresh --seed
to populate database with dummy data. - Run
php artisan serve
to start server. - Visit
http://127.0.0.1:8000/
orhttp://127.0.0.1:8000/admin
demo account is shared below.
email: enes@dogan.com
password: password
role: admin
You can turn on/off maintenance mode by running:
php artisan maintenance:on
or
php artisan maintenance:off
I used
- Laravel 8
- Bootstrap 5
- CKeditor
- spatie/laravel-permission
- docker-compose
- mySQL technologies.
In admin create and edit pages I have tried to implement smart solution to generate forms: In models:
class News extends Model {
...
public $formColumns = [
'title' => [
'label' => 'Title',
'type' => 'text',
],
'body' => [
'label' => 'Body',
'type' => 'html',
],
'category_id' => [
'label' => 'Category',
'type' => 'relationship',
'relation_column' => 'name',
'model' => Category::class
],
'user_id' => [
'label' => 'User',
'type' => 'relationship',
'relation_column' => 'name',
'model' => User::class
],
'is_draft' => [
'label' => 'Save as draft',
'type' => 'checkbox',
]
];
...
}
In blade
<h1>Edit News</h1>
<form method="post" action="{{route('admin.news.update',['news' => $model->id])}}">
@csrf
@method('put')
@include('forms.generic')
@include('forms.save')
</form>