title: How to pass a database data instead of array in the controller
body: <p>In my controller in finorfail it returns array but instead i want pass package name
  My controller:</p>
  <pre><code>    public function package($package){
          $package = Packages::findOrFail($package);
          return view('pages.package',[
              'package' =&gt; $package,
          ]);
      }
  </code></pre>
  <p>My we.php:</p>
  <pre><code>Route::prefix('/packages')-&gt;group(function() {
      Route::get('/', 'PackageController@packages')-&gt;name('package.show');
      Route::get('/{package}', 'PackageController@package')-&gt;name('package.show');
  });
  </code></pre>
  <p>My Model:</p>
  <pre><code>class Packages extends Model
  {
      protected $table = 'packages';
  
      protected $fillable = ['Package_Banner_Image','Package_Image','Package_Type','Package_Name','Package_Short_Description','Package_Price','Package_Duration','Package_Level','Package_Location'];
  }
  </code></pre>
  <p>SO i want to pass PackageName instead of array of numbers
  <a href="https://i.stack.imgur.com/3h6rO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3h6rO.png" alt="enter image description here" /></a>
  So instead of 1 i want it to be package name in the url</p>
  <p>My Migration:</p>
  <pre><code>   public function up()
      {
          Schema::create('pages', function (Blueprint $table) {
              $table-&gt;increments('id');
              $table-&gt;string('title')-&gt;nullable();
              $table-&gt;string('slug')-&gt;nullable();
              $table-&gt;text('description')-&gt;nullable();
              $table-&gt;string('image')-&gt;nullable();
              $table-&gt;string('meta_title')-&gt;nullable();
              $table-&gt;text('meta_description')-&gt;nullable();
              $table-&gt;integer('main')-&gt;nullable();
              $table-&gt;string('publish')-&gt;nullable();
              $table-&gt;timestamps();
          });
      }
  </code></pre>