# Getting Started with Kotchasan Framework ## Creating a New Project ### 1. Create Project ```bash # Create new project composer create-project kotchasan/framework my-app # Navigate to project directory cd my-app ``` ### 2. Environment Setup ```bash # Copy environment file cp .env.example .env # Generate application key php artisan key:generate ``` ### 3. Database Setup ```bash # Run migrations php artisan migrate # Seed initial data php artisan db:seed ``` ## Project Structure ``` my-app/ ├── app/ │ ├── Controllers/ # Controllers │ ├── Models/ # Models │ ├── Middleware/ # Middleware │ └── Services/ # Business Logic ├── config/ # Configuration files ├── database/ │ ├── migrations/ # Database migrations │ └── seeders/ # Database seeders ├── public/ # Web root ├── resources/ │ ├── views/ # Blade templates │ └── assets/ # CSS, JS, Images ├── routes/ # Route definitions ├── storage/ # Logs, cache, sessions └── tests/ # Test files ``` ## Creating Controllers ### 1. Create New Controller ```bash php artisan make:controller HomeController ``` ### 2. Write Controller ```php 'Home Page', 'message' => 'Welcome to Kotchasan Framework' ]; return $this->view('home', $data); } public function about() { return $this->view('about', [ 'title' => 'About Us' ]); } } ``` ## Creating Models ### 1. Create New Model ```bash php artisan make:model User ``` ### 2. Write Model ```php 'datetime', 'password' => 'hashed', ]; // Relationships public function posts() { return $this->hasMany(Post::class); } } ``` ## Creating Views ### 1. Create View File ```html
= $message ?>
Start building your application right away