0👍
Consider the @Flash answer, it’s a good idea. Another way could be changing the method in controller. For example if you have a store
method in ExampleController
that saves/process the form, comment the lines inside the method like this:
public function store(Request $request)
{
/*
$request->validate([
'name' => 'required',
'display' => 'required',
]);
$category = new Category();
$category->parent_id = $request->parent_id;
$category->name = $request->name;
$category->display = $request->display;
$category->save();
return redirect()->route('category.add');
*/
}
- [Vuejs]-Run Vue/vitejs and ASP.net core web API on same server
- [Vuejs]-Unknown custom element: <app-home> – did you register the component correctly? For recursive components, make sure to provide the "name" option
0👍
-
Create a dummy user in your database and have a middleware in place(if you did not have it before).
-
Save the demo user ID in a config file, let’s say
config/app.php
. -
When someone visits your demo site, ask them to login and provide them the demo user credentials.
-
Create a session after the login(which you would anyway) with that user and whenever a post or any request that would affect the database is made, check like below-
Middleware Code:
if(Auth::user()->id === config('app.dummy_user_id'){
if($request->getMethod() === 'GET' || $request->getMethod() === 'OPTIONS'){
// for OPTIONS, you would play with the headers which I leave to you to edit
return $next($request);
}else{
return redirect()->back();
}
}
// your further processing
return $next($request);
- [Vuejs]-For each item add class if value is true
- [Vuejs]-How to show value dynamically in vue js wth div
Source:stackexchange.com