diff --git a/README.md b/README.md index c32bd42..973165d 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ # Goravel +[![Release](https://img.shields.io/github/release/saalikmubeen/goravel.svg?style=flat-square)](https://github.com/saalikmubeen/goravel/releases) + PHP's Laravel like web framework supercharged with Go. @@ -85,10 +87,6 @@ go mod tidy 6. Run the server: -```bash -goravel serve -``` -`OR` ```bash go run ./*.go @@ -147,3 +145,8 @@ You don't have to do anything. Just run this command and you are good to go. - `goravel make session`: Generates all the necessary files for session management if you want to use database for session storage. This creates and runs migrations for session tables, again saving you from the hassle of writing boring migration files. + + +## License + +Goravel is open-source software licensed under the [MIT license](https://opensource.org/licenses/MIT). \ No newline at end of file diff --git a/cmd/goravel/copy.go b/cmd/goravel/copy.go index d5b1528..4f70fe3 100644 --- a/cmd/goravel/copy.go +++ b/cmd/goravel/copy.go @@ -6,7 +6,7 @@ import ( "os" ) -//go:embed templates +//go:embed "all:templates" var templateFS embed.FS func copyFilefromTemplate(from string, to string) error { diff --git a/cmd/goravel/templates/handlers/auth_handlers.go.txt b/cmd/goravel/templates/handlers/auth_handlers.go.txt index 47cb7e0..7d03532 100644 --- a/cmd/goravel/templates/handlers/auth_handlers.go.txt +++ b/cmd/goravel/templates/handlers/auth_handlers.go.txt @@ -119,7 +119,10 @@ func (h *Handlers) Logout(w http.ResponseWriter, r *http.Request) { } func (h *Handlers) UserSignup(w http.ResponseWriter, r *http.Request) { - err := h.App.Render.Page(w, r, "signup", nil, nil) + var user = models.User{} + vars := make(jet.VarMap) + vars.Set("user", user) + err := h.App.Render.Page(w, r, "signup", vars, nil) if err != nil { h.App.ErrorLog.Println(err) } diff --git a/cmd/goravel/templates/handlers/handler.go.txt b/cmd/goravel/templates/handlers/handler.go.txt index 7157c13..d313792 100644 --- a/cmd/goravel/templates/handlers/handler.go.txt +++ b/cmd/goravel/templates/handlers/handler.go.txt @@ -2,12 +2,14 @@ package handlers import ( "net/http" + + "github.com/saalikmubeen/goravel" ) // $HANDLERNAME$ is a generated handler function func (h *Handlers) $HANDLERNAME$(w http.ResponseWriter, r *http.Request) { - h.App.WriteJSON(w, http.StatusOK, map[string]interface{}{ + h.App.WriteJSON(w, http.StatusOK, goravel.Response{ "data": "Happy coding!", }) diff --git a/cmd/goravel/templates/new/go.mod.txt b/cmd/goravel/templates/new/go.mod.txt index 0b28ea3..cf5f170 100644 --- a/cmd/goravel/templates/new/go.mod.txt +++ b/cmd/goravel/templates/new/go.mod.txt @@ -3,7 +3,7 @@ module ${APP_URL} go 1.22.3 require ( - github.com/saalikmubeen/goravel v1.5.1 + github.com/saalikmubeen/goravel v1.6.0 github.com/CloudyKit/jet/v6 v6.2.0 github.com/go-chi/chi/v5 v5.0.12 github.com/upper/db/v4 v4.7.0 diff --git a/goravel.go b/goravel.go index f9adb69..49a3f69 100644 --- a/goravel.go +++ b/goravel.go @@ -23,7 +23,7 @@ import ( const ( // Version of Goravel - Version = "1.5.1" + Version = "1.6.0" // http://patorjk.com/software/taag/#p=display&f=Ogre&t=Goravel Banner = ` ___ _