Category : routes

help me to find the problem, the laravel project gives error before loading Route [people.comments] not defined I copied and pasted the route name, copied and pasted the working routes, but no, it doesn’t work. Route::post(‘/people/comments’, ‘[email protected]’)->name(‘people.comments’); And It worked when I changed method POST to GET Route::get(‘/people/comments’, ‘[email protected]’)->name(‘people.comments’); I am using this route inside ..

Read more

I am trying to post data to a controller through ajax request. But it can’t find the route and says the following in console. POST http://127.0.0.1:8000/addNotification_action 404 (Not Found) This is my ajax call below. function editNotification(obj) { // alert(obj.id); var obj_id = obj.id; var id = obj_id.split("_"); $.ajax({ url: "{{ url(‘addNotification_action’) }}", type: ‘POST’, ..

Read more

I need to develop a project with subdomains in Laravel 7.28. I’ll pass subdomain variable and check whether that user belongs to that particular domain. I have installed Xampp on local. I tried these two ways: 1 Route::domain(‘{subdomain}.myapp.com’)->group(function (){ Route::get(‘/’, ‘CRM/[email protected]’)->name(‘subdomain-index’); }); 2 Route::group([‘domain’ => ‘{domain}.localhost’], function() { Route::get(‘/’, ‘[email protected]’)->name(‘crm.index’); Route::get(‘login’, ‘[email protected]’)->name(‘crm.login’); Route::post(‘login’, ‘[email protected]’)->name(‘crm.login.post’); Route::get(‘register’, ..

Read more

When switching to a subdomain page endless load nothing happens, no errors. My httpd.conf <VirtualHost *:8000> ServerName example.com ServerAlias *.example.com DocumentRoot "/var/www/html/blog/public" </VirtualHost> hosts file 127.0.0.1 localhost 127.0.1.2 example.com 127.0.1.2 *.example.com Routes Route::get(‘/’, function () { #dd(request()->cookie()); return view(‘home.home’); })->name(‘home’); Route::domain(‘{username}.’.env(‘SESSION_DOMAIN’))->group(function () { Route::get(‘/’, [PostController::class,’getAllPosts’]) ->name(‘blog’); }); in .env SESSION_DOMAIN=example.com I do not understand what ..

Read more

I have a route same like this. Route::group([‘prefix’=>LaravelLocalization::setLocale(), ‘as’=>’front.’, ‘middleware’=>[‘localeSessionRedirect’,’localizationRedirect’,]],function () { Route::get(‘/view/post/{id}’, [ExtraController::class, ‘SinglePost’])->name(‘post_view’); }); So i want call this route in blade.How i get post_view route? Sourc..

Read more

I have a route in web.php Route::get(‘/{slug_category}’, ‘[email protected]’)->name(‘cdetail’); Route::get(‘/{slug_category}/{slug}’, ‘[email protected]’)->name(‘detail’); and my category slug in the database is action, movie when I access /action or /movie its shows well. But when I access something like /test or /something slug that not in the database it shows an error like this How to solve when I ..

Read more

I try to create routes to my index.blade.php page, i’ve made a controller "ProductController" using cmd php artisan make:controller ProductController, so in http –> Controllers i do have a ProductController.php file and i put this code in it : <?php namespace AppHttpControllers; use IlluminateHttpRequest; class ProductContoller extends Controller { public function index() { return view(‘products.index’); ..

Read more

I’m using laravel ui auth and I’ve generated the auth routes by: Auth::routes(); in web.php. Then I wanted to change the ‘/login’ url to ‘/login-dashbored’, so I did this in my web.php: Route::get(‘/login-dashboard’, [LoginController::class, ‘showLoginForm’]); Now the problem is that the Route::get(‘/login’, [LoginController::class, ‘showLoginForm’]); which was created by Auth::routes(); is still there and the url ..

Read more

here is my simple form <form id="test-form" class="white-popup-block mfp-hide"> <div class="popup_box "> <div class="popup_inner"> <h3>Make an Appointment</h3> <form action="{{route(‘doctorwithdatepopup’,[‘date’=>$date,’id’=>$doctorsid])}}" method="POST"> @csrf <div class="row"> <div class="col-xl-6"> <input id="datepicker" placeholder="Pick date" name="date"> </div> @php $Department = DB::table(‘departments’)->orderBy(‘id’,’desc’)->get(); @endphp <div class="col-xl-6"> <select class="form-select wide" id="departmentid" name="departmentid"> <option data-display="Select Department">Department</option> @foreach ($Department as $item) <option value="{{$item->id}}">{{$item->name}}</option> @endforeach </select> </div> ..

Read more

When I extend a GET route with a parameter, the page is not loaded completely and there is delay in loading the page, so what is the solution? This is the route Route::get(‘/Report/{sub_date_number}’, [reportController::class,’show_orders_report’])->Middleware(‘isAdmin’); and this is the function definition of show_order_report function in the controller public function show_orders_report($sub_date_number){ Sourc..

Read more

I use Laravel 8, nWidart modules, and Vue3, vue3 router. I have 3 module. Authentication, Dashboard and Courses. I can route from Auth->Dashboard, Auth->Course, Dashboard->Course, but i can’t route from Dashboard to Auth. I dont know what is the problem. When I insert this line to Dashboard module /router/index.js I get error. import Login from ..

Read more

I have created an Laravel API endpoint api/post/offer where it would create a post. Using a post request from postman. postman post request Then it will access the route at api.php Route::post(‘post/offer’, [PostController::class, ‘create_offer_post’]); Using the create_offer_post method in my PostController public function create_offer_post(OfferPostRequest $request) { //validate data $validated = $request->validated(); // if logged in ..

Read more

I’m using spatie’s laravel-permission package and created roles and permissions on my application and wrote a bypass for the super-admin role, as specified on their doc, in the AuthServiceProvider. It worked like a charm, and suddenly it stopped working for no apparent reason, returning a 403 error. I already rebooted the server and cleared routes ..

Read more

I want to print a newly created element added to database immediately after inserting. For the insertion, this is hadled with class CarrierController extends Controller … public function create() { … return view(‘admin.carriers.create’, compact(‘components’, ‘suppliers’, ‘containers’)); for printing, I created a route and a view. This Route is handling the print request: Route::get(‘carriers/print-label/{carrier}’, ‘Ca[email protected]’)->name(‘carriers.print-label’); Question ..

Read more

I am trying to view multilingual articles when i click to read more button on blog page blog page view(blog controller and view working fine) @foreach($leg as $sost) <div> <a href="{{route(‘view-post’, [‘lang’=>app()->getLocale(), ‘slug’=>$sost->slug])}}">{{$sost->title }} </div> @endforeach Route Route::get(‘{lang}/article/{slug}’, [AppHttpControllersfrontendpersonalmycashmycashcontroller::class, ‘view’])->name(‘view-post’); MycashController use AppModelsmycash; public function view( $lang,$slug) { $post = mycash::where(‘slug’, $slug)->firstOrFail(); return view(‘frontend/Personal/articles’,compact(‘post’ , ..

Read more

I am trying to view multilingual articles when i click to read more button on blog page blog page view(blog controller and view working fine) @foreach($leg as $sost) <div> <a href="{{route(‘view-post’, [‘lang’=>app()->getLocale(), ‘slug’=>$sost->slug])}}> {{ $sost->title }} </div> @endforeach Route Route::get(‘{lang}/article/{slug}’, [AppHttpControllersfrontendpersonalmycashmycashcontroller::class, ‘view’])->name(‘view-post’); MycashController use AppModelsmycash; public function view( $lang,$slug) { $post = mycash::where(‘slug’, $slug)->firstOrFail(); return ..

Read more

I am working on a blog in Laravel 8 and i ran into a problem. I want the user to be able to comment on a post. Do do that i store the id of the post they are commenting on. This is my comment form: <form method="POST" action="{{ route(‘comment.store’, $post )}}"> @csrf <div class="form-group"> ..

Read more