Yes, it is possible to create a website powered by Laravel API without using any frontend framework like Vue.js. You can use traditional server-side rendering techniques to render the HTML on the server and send it to the client. You can use Laravel's built-in Blade templating engine to create the views and use Laravel's routing system to handle the requests.
For authentication and authorization, you can use Laravel's built-in authentication system or implement your own custom authentication system using Laravel's middleware. You can also use Laravel's built-in CSRF protection to prevent cross-site request forgery attacks.
Here's an example of how you can create a simple website powered by Laravel API without using any frontend framework:
// routes/web.php
Route::get('/', function () {
return view('welcome');
});
Route::get('/posts', function () {
$posts = App\Models\Post::all();
return view('posts', ['posts' => $posts]);
});
// views/welcome.blade.php
<!DOCTYPE html>
<html>
<head>
<title>Welcome</title>
</head>
<body>
<h1>Welcome to my website</h1>
<p>Click <a href="/posts">here</a> to view all posts</p>
</body>
</html>
// views/posts.blade.php
<!DOCTYPE html>
<html>
<head>
<title>Posts</title>
</head>
<body>
<h1>All Posts</h1>
<ul>
@foreach ($posts as $post)
<li>{{ $post->title }}</li>
@endforeach
</ul>
</body>
</html>
In this example, we have two routes: one for the homepage and one for the posts page. The homepage simply displays a welcome message and a link to the posts page. The posts page retrieves all the posts from the database and displays them in a list.
Note that this is just a simple example and you can create more complex websites using this approach. However, keep in mind that using a frontend framework like Vue.js can make your website more interactive and responsive.