Laravel Blog – canonical route does not work

I built a small blog controller to add a blog to my website like http://example.com/blog/post It works fine with the post id like: http://example.com/blog/1 But it doesn’t work with http://example.com/blog/postTitle Here is my code: Routes: Route::get(‘/blog/{blogPost}’, [‘as’ => ‘blogPost’, ‘uses’ => ‘BlogPostController@show’]); BlogPostControler.php : public function show(BlogPost $blogPost) { return view(‘blog.show’, [ ‘post’ => $blogPost,… Read More Laravel Blog – canonical route does not work

Powershell regex group : how do I get all subgroups 2

I want to extract file1, file2 I know how to do this in javascript, I’m lost in Powershell, I can only extract the whole second match following that tut https://devblogs.microsoft.com/scripting/regular-expressions-regex-grouping-regex/, what’s the syntax ? $regex = ‘(.+\\)*(.+)\.(.+)$’ $data = @’ "C:\test\file1.txt" "C:\test\file2.txt" ‘@ [RegEx]::Matches($data,$regex).value >Solution : Here is how you could do it using the… Read More Powershell regex group : how do I get all subgroups 2

AsyncCommand in .NET MAUI

I can’t seem to find AsyncCommand in .NET MAUI or .NET MAUI Community Toolkit. Any idea what package/namespace I can find it? >Solution : https://devblogs.microsoft.com/dotnet/introducing-the-net-maui-community-toolkit-preview/#what-to-expect-in-net-maui-toolkit The .NET MAUI Toolkit will not contain the MVVM features from Xamarin Community Toolkit, like AsyncCommand. Going forward, we will be adding all MVVM-specifc features to a new NuGet Package,… Read More AsyncCommand in .NET MAUI

Npm Start Returning index.html instead of React Rendered Page

I’m new to react but something is not working on the backend. When I run npm start it servers up the blank index.html page instead of rendering from index.js Everything works fine in code sandbox, but I can’t run it locally. Here is my index.js file ReactDOM.Render( <HashRouter> <Routes> <Route path="/" element={<App />} /> <Route… Read More Npm Start Returning index.html instead of React Rendered Page

Django – How Do I Set A Default Value In A Form To Be The Current User?

quick beginner Django question because I haven’t been able to find an answer that directly solves what i’m after, or doesn’t add in a bunch of overcomplicated functionality I don’t need with its answer. I have a basic Blog setup, with a model for users and their associated posts, and a form for creating new… Read More Django – How Do I Set A Default Value In A Form To Be The Current User?