Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9150819
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:39:44+00:00 2026-06-17T11:39:44+00:00

So I have been trying to use the put method in my routing, I

  • 0

So I have been trying to use the “put” method in my routing, I have followed this example directly from the “routes.php” file:

Route::put('hello/(:any)', function($name)
{
      return "Welcome, $name.";
});

This returns a 404 error, I really want my code to look like below. I want to be able to take to parameters from the url and use them for verification, later on I plan to use an encoding method but for now I just wanted to get the routes working properly before I tried encoding them. Any help would be greatly appreciated!!!

Route::put('admin/activate/(:any?)/(:any?)', function($r, $e) {
     return "Random value: $r <br/> Email: $e";
});

You can find the page here: http://diverseevolution.com/admin/activate/randomstring/test@gmail.com

Here is my overall “routes.php” file:

Route::get('/', function() {
     return View::make('homepage.index');
});

///////////////////////////////////////////////////////////////////////////////////////////
///////////////        Administration Account Creation & Login        /////////////////////
///////////////////////////////////////////////////////////////////////////////////////////

// Create account
Route::get('admin/createform', function() {
     return View::make('admin.createform');
});

// action for actual admin creation
Route::post('admin/create', array('before' => 'csrf', function() {
     $rules = array(
          'fname' => 'required|min:3',
          'lname' => 'required|min:3',
          'email' => 'required|email|unique:users',
          'pword' => 'required'
     );

     $validated = Validator::make(Input::all(), $rules);

     if($validated -> fails()) {
          return Redirect::to('admin/createform')->with_input();
     } else {
          $r = Hash::make(time() .'ReAl19dk4-^4$'. $_POST['pword']);

          $user = new User;

          $user -> fname = $_POST['fname'];
          $user -> lname = $_POST['lname'];
          $user -> email = $_POST['email'];
          $user -> pword = Hash::make($_POST['pword']);
          $user -> status = 'unactivated';
          $user -> random = $r;

          if($user -> save()) {

               //////////////////////// Email /////////////////////////////////
               // We still need to make this functionality

               $msg = '
               <h1>Your admin account has been created!</h1>
               <p>Congratulations on creating your new account, there is one last step before your account can be activated. Below is a link, simply follow the link to activate your account, once you have your account will be active and you will be able to login!</p>
               <p><a href="http://diverseevolution.com/admin/activate/'. $r .'/'. $_POST['email'] .'">http://diverseevolution.com/admin/activate/'. $r .'/'. $_POST['email'] .'</a></p>
               <p>Thanks, Diverse Evolution</p>
               ';

                    // Mail headers
                    $headers  = "Reply-To: Diverse Evolution <info@diverseevolution.com>\r\n"; 
                    $headers .= "Return-Path: Diverse Evolution <info@diverseevolution.com>\r\n"; 
                    $headers .= "From: Diverse Evolution <info@diverseevolution.com>\r\n"; 
                    $headers .= "Organization: Diverse Evolution\r\n";
                    $headers .= 'MIME-Version: 1.0' . "\r\n";
                    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
                    $headers .= "X-Priority: 3\r\n";
                    $headers .= "X-Mailer: PHP". phpversion() ."\r\n";
                    define('_headers', $headers);

               if(mail($_POST['email'], 'Diverse Evolution Account Created', $msg, _headers)) {
                    return Redirect::to('admin/thanks');
               } else {

               }
          } else {
               return Redirect::to('admin/createform')->with_input();
          }

     }
}));

// creates the thank you page for the admin account creation
Route::get('admin/thanks', function() {
     return View::make('admin/thanks');
});

// account activation email, this is still not working 011613
Route::put('admin/activate/(:any?)/(:any?)', function($r, $e) {
     return "Random value: $r <br/> Email: $e";
});

// Login form
Route::get('admin/loginform', function() {
     return View::make('admin/loginform');
});

// Login action
Route::post('admin/login', array('before' => 'csrf', function() {
     $rules = array(
          'email' => 'required|email',
          'pword' => 'required'
     );

     $validated = Validator::make(Input::all(), $rules);

     if($validated -> fails()) {
          return Redirect::to('admin/loginform')->with_input();
     } else {
          $credentials = array('username' => $_POST['email'], 'password' => $_POST['pword']);

          if (Auth::attempt($credentials)) {
               return Redirect::to('admin/dash');
          } else {
               return Redirect::to('admin/loginform')->with_input();
          }
     }
}));

Route::get('admin/logout', function() {
     Auth::logout();
     return Redirect::to('admin/loginform');
});

///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////        Administration Pages        ////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
Route::group(array('before' => 'auth'), function() {
    Route::get('admin/dash', function() {
        return 'Dashboard';
    });
});















/*
|--------------------------------------------------------------------------
| Application 404 & 500 Error Handlers
|--------------------------------------------------------------------------
|
| To centralize and simplify 404 handling, Laravel uses an awesome event
| system to retrieve the response. Feel free to modify this function to
| your tastes and the needs of your application.
|
| Similarly, we use an event to handle the display of 500 level errors
| within the application. These errors are fired when there is an
| uncaught exception thrown in the application.
|
*/

Event::listen('404', function()
{
    return Response::error('404');
});

Event::listen('500', function()
{
    return Response::error('500');
});

/*
|--------------------------------------------------------------------------
| Route Filters
|--------------------------------------------------------------------------
|
| Filters provide a convenient method for attaching functionality to your
| routes. The built-in before and after filters are called before and
| after every request to your application, and you may even create
| other filters that can be attached to individual routes.
|
| Let's walk through an example...
|
| First, define a filter:
|
|       Route::filter('filter', function()
|       {
|           return 'Filtered!';
|       });
|
| Next, attach the filter to a route:
|
|       Route::get('/', array('before' => 'filter', function()
|       {
|           return 'Hello World!';
|       }));
|
*/

Route::filter('before', function()
{
    // Do stuff before every request to your application...
});

Route::filter('after', function($response)
{
    // Do stuff after every request to your application...
});

Route::filter('csrf', function()
{
    if (Request::forged()) return Response::error('500');
});

Route::filter('auth', function()
{
    if (Auth::guest()) return Redirect::to('admin/loginform');
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T11:39:45+00:00Added an answer on June 17, 2026 at 11:39 am

    You didnt include your form – but I’m guessing you didnt include a “PUT” in the form.

    echo Form::open('user/profile', 'PUT');
    

    You can see more about forms and PUT here. But in general, you need to specifically include PUT in your form, otherwise it will just be POST (browser default).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to use array_unique to remove duplicates from the search results
I have been trying to use routes.rb for creating a URL /similar-to-:product (where product
I have been trying to use the hibernate dialect for SQLite from http://code.google.com/p/hibernate-sqlite/ in
I have been trying to use the document.getElementByID to pull information from an HTML
I have been working with the example code from the ExecutorCompletionService and put together
I have been trying to use date_format , however as far as I know,
I have been trying to use/save the boolean value of a checkbox in other
I have been trying to use 3rd party tool called visiblox for rendering charts
Right now I have been trying to use Launchpad's API to write a small
Ok I'm stumped. I have been trying to use Simpletip to create a tooltip

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.