Laravel forms don't proccess external urls - laravel

I have an application in Laravel 8 running in Cpanel. I have a form to edit blog posts. When I insert an external image to display in the body of the post and save the form the application crashes. when I remove the image the form works.
BadMethodCallException
Method App\Http\Controllers\Backend\NewsBackController::show does not exist.
The same app in another server works fine.
Update in controller
public function update(Request $request, $id)
{
$post = Post::find($id);
$post->title = $request->input('title');
$post->slug = $request->input('slug');
$post->sumary = $request->input('sumary');
$post->content = $request->input('content');
$post->img = $request->input('img');
$post->tag_id = $request->input('tag_id');
$post->pub_date = $request->input('pub_date');
$post->status = $request->input('status');
$post->save();
return redirect('backend-news/'.$id.'/edit')->with('success', 'Successful update!');
}
Form in blade
#csrf
<div class="row">
<div class="col-md-8">
<div class="form-group ">
<label >Title</label>
<input type="text" name='title' class="form-control" #if(!empty($content->title)) value="{{$content->title}}" #endif required>
</div>
#if ($form == 'update')
<div class="form-group ">
<label>Slug</label>
<input type="text" name='slug' class="form-control" #if(!empty($content->slug)) value="{{$content->slug}}" #endif>
</div>
#endif
<div class="form-group ">
<label >Sumary <small>(120 characters max.)</small></label>
<textarea name="sumary" class="form-control" rows="4">#if(!empty($content->sumary)){{$content->sumary}} #endif</textarea>
</div>
<div class="form-group ">
<label >Content</label>
<textarea name="content" class="form-control summernote" rows="15">#if(!empty($content->content)){{$content->content}} #endif</textarea>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label>Image Large <small>(120 characters max.)</small></label>
<input type="text" name='img' class="form-control" #if(!empty($content->img)) value="{{$content->img}}" #endif>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group ">
<label for='group'>Tags</label>
<select class="form-control m-b" name="tag_id">
<option value='0'>--SELECT--</option>
#foreach ($tags as $tag)
#php
if($form == 'update'){
$selected = ($content->tag_id == $tag->id)?'selected':'';
}else{
$selected = '';
}
#endphp
<option value='{{$tag->id}}' {{$selected}}>{{$tag->name}}</option>
#endforeach
</select>
</div>
</div>
<div class="col-md-6">
<div class="form-group ">
<label >Pub Date</label>
<div class="input-group date">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span><input type="text" class="form-control" name='pub_date'
#if (!empty($content->pub_date))
value="{{$content->pub_date}}"
#else
value="{{date('Y-m-d')}}"
#endif
>
</div>
</div>
</div>
</div>
<div class="form-group ">
<label for='group'>Status</label>
<select class="form-control m-b" name="status">
#if ($form == 'update')
#if ($content->status == 1)
<option value='1' selected>Published</option>
<option value='0'>Unpublish</option>
#else
<option value='1'>Published</option>
<option value='0' selected>Unpublish</option>
#endif
#else
<option value='1'>Published</option>
<option value='0'>Unpublish</option>
#endif
</select>
</div>
<div class="hr-line-dashed"></div>
<button type="submit" class="btn btn-w-m btn-success">Save</button>
#if(!empty($put))
<input type="hidden" name="_method" value="PUT">
#endif
<i class="fas fa-undo-alt"></i> Return
</div>
</div>
Thanks

First double check your controller, does it have show function or not?
If show function exists, run following artisan command:
php artisan cache:clear
php artisan config:cache
php artisan view:clear
php artisan route:clear
If show function doesn't exists, create it.
Hope this will be useful.

Related

Livewire - Call to a member function getClientOriginalExtension() on string

I get a error from livewire file uploading "Call to a member function getClientOriginalExtension() on string" Please help me any why I get the problem from livewire controller functions. I attached livewire form and controller function codes.
<div class="mb-3 col-xl-8">
<div class="card">
<div class="card-body">
<form wire:submit.prevent="RegisterNewUserAdmin">
<div class="row">
<div class="col-lg-1">
<select class="form-control" wire:model.prevent="RegisterUserMethods">
<option value="" selected>Select</option>
<option value="manually">Manually</option>
<option value="fromXLSfile">From XLS File</option>
</select>
</div>
<div class="col-lg-3">
<input type="text" wire:model="newusername" class="form-control" placeholder="Write User Full Name" required>
</div>
<div class="col-lg-3">
<input type="email" wire:model="newuseremail" class="form-control" placeholder="Write Email ID" required>
</div>
<div class="col-lg-3">
<input type="password" wire:model="newuserpassword" class="form-control" placeholder="Password" required>
</div>
<div class="col-lg-9">
<input type="file" wire:model="NewUserxlsFile" class="form-control" required>
</div>
<div class="col-lg-2">
<button type="submit" class="btn btn-success w-100"><div wire:loading wire:target="RegisterNewUserAdmin" class="spinner-border"></div> Add Now</button>
</div>
</div>
</form>
</div>
</div>
</div>
Controller Function
public function RegisterNewUserAdmin()
{
$str = Str::random(10);
$file = $this->NewUserxlsFile;
$filename = $str.'.'.$file->getClientOriginalExtension();
$path = $this->NewUserxlsFile->storeAs('files/xls/', $filename, 'public');
$data = Excel::load($path)->get();
dd($data);
}

Laravel : Create Button returns the same view but blank and does not create any record

I am new to laravel and I am working on creating a CMS. I have created a view to create posts but after I input data and click create to submit, page refreshes and shows the same view but with no input and no record created, when it should show a flash message and return the posts index view.
Here is my VIEW HTML:
#section('content')
<div class="card card-default">
<div class="card-header">
{{ isset($post) ? 'Edit Post' : 'Create Post' }}
</div>
<div class="card-body">
<form action="{{ isset($post) ? route('posts.update', $post->id) : route('posts.store') }}" method="POST" enctype="multipart/form-data">
#csrf
#if (isset($post))
#Method('PUT')
#endif
<div class="form-group">
<label for="title">Title</label>
<input type="text" class="form-control" name="title" id="title" value="{{isset($post) ? $post->title : ""}}">
</div>
<div class="form-group">
<label for="description">Description</label>
<textarea name="description" id="description" cols="5" rows="3" class="form-control">{{isset($post) ? $post->description : ""}}</textarea>
</div>
<div class="form-group">
<label for="content">Content</label>
<input id="content" type="hidden" name="content" value="{{isset($post) ? $post->content : ""}}">
<trix-editor input="content"></trix-editor>
</div>
<div class="form-group">
<label for="published_at">Published at</label>
<input type="text" class="form-control" name="published_at" id="published_at" value="{{isset($post) ? $post->published_at : ""}}">
</div>
#if (isset($post))
<div class="form-group">
<img src="{{ asset('/storage/'.$post->image) }}" alt="" style="width: 100%">
</div>
#endif
<div class="form-group">
<label for="category">Category</label>
<select name="category" id="category" class="form-control">
#foreach($categories as $category)
<option value="{{$category->id}}">{{$category->title}}</option>
#endforeach
</select>
</div>
<div class="form-group">
<label for="image">Image</label>
<input type="file" class="form-control" name="image" id="image">
</div>
<div class="form-group">
<button type="submit" class="btn btn-success">
{{ isset($post) ? 'Update Post' : 'Create Post' }}
</button>
</div>
</form>
</div>
</div>
#endsection
Here is METHOD:
public function store(CreatePostRequest $request)
{
$image = $request->image->store('posts');
Post::create([
'title'=>$request->title,
'description'=>$request->description,
'image'=>$image,
'content'=>$request->content,
'published_at' => $request->published_at,
'category_id' => $request->category
]);
session()->flash('success', 'Post Created Successfully');
return redirect(route('posts.index'));
}
What am I doing wrong?
Thanks,

Editing user info using laravel

I've built a cms interface for the admin in my website. among other things the admin can add\edit users info using forms.
when I send the edit form I keep getting this error: Column not found: 1054 Unknown column 'updated_at' in 'field list' which suggests that the DB update is trying to save all of the request indexes (which contains values of columns from other table) and not just the one I'm trying to update.
I've manage to track the problem to one line $user_role->save();.
the lines above that do what their suppose to (finding thr correcct user_role and change its value).
Here is my code
Model
static public function update_user($request, $id){
$image_name = '';
if( !empty($request['profile_image']) && $request->hasFile('profile_image') && $request->file('profile_image')->isValid() ){
$file = $request->file('profile_image');
$image_name = date('Y.m.d.H.i.s') . '-' . $file->getClientOriginalName();
$request->file('profile_image')->move( public_path() . '/images/profile-images/' , $image_name);
$img = Image::make( public_path() . '/images/profile-images/' . $image_name );
$img->resize(370, null, function ($constraint) {
$constraint->aspectRatio();
});
$img->save();
}
$user = self::find($id);
$user->name = $request['name'];
$user->email = $request['email'];
$user->phone = $request['phone'];
if( !empty($request['password']) ){
$user->password = bcrypt($request['password']);
}
if(!empty($image_name)){
$user->profile_image = $image_name;
}
if( !empty($request['role_id']) ){
$user_role = Users_role::find($id);
$user_role->role_id = $request['role_id'];
$user_role->save();
}
$user->save();
Session::flash('sm', 'Your profile has been updated');
Session::flash('sm-position', 'toast-top-center');
Session::put('user_name', $request['name']);
}
View
<div class="row">
<div class="span9">
<div class="content">
<div class="module message">
<div class="module-head">
<h3><b>Edit Product</b></h3>
</div><br>
<div class="content">
<div class="module message">
<div class="module-body">
<form action="{{ url('cms/users/' . $user->id) }}" method="POST" novalidate="novalidate" autocomplete="off" enctype="multipart/form-data">
<div class="module-body">
#method('PUT')
#csrf
<input type="hidden" name="user_id" value="{{ $user->id}}">
<div class="form-group">
<div class="input-group mb-3">
<div class="w-100 field-input-cms">
<label for="category-id" class="input-group-text h-50"><span class="text-danger">*</span><b> Permissions:</b></label>
<select name="role_id" class="custom-select span-8">
<option #if ( $user->role_id == 8 ) selected="selected" #endif value="8">Admin</option>
<option #if ( $user->role_id == 2 ) selected="selected" #endif value="2">Regular</option>
</select>
</div>
<small class="text-muted help-text">Please select one option</small><br>
<span class="text-danger"> {{ $errors->first('category_id') }}</span>
</div>
<div class="w-100 field-input-cms">
<label for="name" class="input-group-text h-100"><span class="text-danger">*</span><b> Name:</b></label>
<input type="text" value="{{ $user->name }}" name="name" style="width:100%" class="form-control" aria-label="Sizing example input" aria-describedby="inputGroup-sizing-default">
</div>
<small class="text-muted help-text">Name of user</small><br>
<span class="text-danger"> {{ $errors->first('name') }}</span>
<div class="field-input-cms w-100">
<label for="email" class="input-group-text"><span class="text-danger">*</span><b> Email:</b></label>
<input type="text" value="{{ $user->email }}" name="email" size="120" class="form-control mw-100" aria-label="Sizing example input" aria-describedby="inputGroup-sizing-default">
</div>
<small class="text-muted text-balck help-text"> Email of user</small><br>
<span class="text-danger"> {{ $errors->first('email') }}</span>
<div class="field-input-cms w-100">
<label for="phone" class="input-group-text"><span class="text-danger">*</span><b> Phone:</b></label>
<input type="text" value="{{ $user->phone }}" name="phone" size="120" class="form-control mw-100" aria-label="Sizing example input" aria-describedby="inputGroup-sizing-default">
</div>
<small class="text-muted text-balck help-text"> Phone number of user</small><br>
<span class="text-danger"> {{ $errors->first('phone') }}</span>
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="inputGroupFileAddon01">Upload</span>
</div>
<div class="custom-file">
<input type="file" name="profile_image" class="custom-file-input" id="inputGroupFile01" aria-describedby="inputGroupFileAddon01">
<label class="custom-file-label" name="profile_image" for="inputGroupFile01">Choose file</label>
</div>
</div>
<small class="text-muted help-text">Image must be: jpg, jpeg, png, gif. Max: 5mb</small><br>
<span class="text-danger"> {{ $errors->first('profile_image') }}</span>
</div>
<div class="form-group">
<img id="cms-profile-image" src="{{ asset('images/' . $user->profile_image) }}" >
</div><br>
<a class="btn btn-inverse" href="{{ url('cms/users') }}">Cancel</a>
<input type="submit" value="Save Product" name="submit" class="btn btn-primary">
</div>
</form>
</div>
</div>
</div>
</div>
</div> <!--/.content-->
</div><!--/.span9-->
</div>
Image of the error gaven by laravel
I should mention that if I comment out this code:
if( !empty($request['role_id']) ){
$user_role = Users_role::find($id);
$user_role->role_id = $request['role_id'];
$user_role->update();
}
all the values are saved correctly.
If your users table doesn't have created_at and updated_at columns you should set:
public $timestamps = false;
in your User model.
Laravel by default assumes you have those fields for tables. So whenever record is created/updated it will automatically set/update those fields.
Alternatively you can update your table structure to add those fields and then those fields will be automatically handled by Laravel (in such case don't set timestamps to false).
You might be interested to read about Eloquent conventions

Error About Laravel Blade Foreach in Loop if else

There are problem my code about foreach and if condition. When I pulled else code block out of foreach loop there are no problem it is work. But I put in else code in loop. Else dont work and dont show anything.
My purpose, programme check to used user_id in total_bonuses datatable if ok I want to display only update form if no records user_id in total_bonuses I want to show store forum and user add to info. It seems to complicated.
My controller code is below
public function show($lang=null, $id)
{
$bonuses = DB::table('reservations')
->select(DB::raw('SUM(bonus) as total_bonus, user_id'))
->where('user_id', '=', $id)
->groupBy('user_id')
->get();
$dolars = DB::table('reservations')
->select(DB::raw('SUM(dolar) as dolar, user_id'))
->where('user_id', '=', $id)
->groupBy('user_id')
->get();
$confirmeds = DB::table('reservations')
->select(DB::raw('SUM(confirmation) as confirmed, user_id'))
->where('confirmation', '=', 1)
->where('user_id', '=', $id)
->groupBy('user_id')
->get();
$user = DB::table('users')->find($id);
$totals = DB::table('total_bonuses')->where('user_id', '=', $id)->get();
return view('wallet.show', compact('totals', 'user', 'bonuses', 'dolars', 'confirmeds'));
}
View Code is below
#foreach ($totals as $total)
#if ($total->new_dollar !== NULL)
<div class="col-12"><a href="javascript:void(0)" class="link"><i class="mdi mdi-check-circle text-success"></i> <font class="font-medium"> {!! $total->new_dollar !!}
Remaining Dollar</font></a></div>
#endif
</div>
</center>
</div>
<div>
</div>
</div>
</div>
<!-- Column -->
<!-- Column -->
<div class="col-lg-8 col-xlg-9 col-md-7">
<div class="card">
#if (count($total->user_id) === 1)
<br>
<br>
<label class="col-md-12"><h4> Paid Dollar</h4></label>
<form class="form-horizontal form-material" method="POST" action="{{ route ('total.update', ['lang' => App::getLocale(), 'id' => $total->id]) }}">
{{ csrf_field() }}
<input type="hidden" name="_method" value="PATCH">
<input type="hidden" name='id' value='{!! $total->id !!}'>
<input type="hidden" name='user_id' value='{!! $user->id !!}'>
<div class="form-group">
<label class="col-md-12">Total Dollar</label>
<div class="col-md-12">
<input name="old_dollar" type="text" value="{!! $total->new_dollar !!}" class="form-control form-control-line" readonly>
</div>
</div>
<div class="form-group">
<label class="col-md-12">Paid Dollar</label>
<div class="col-md-12">
<input name="paid_dollar" type="text" class="form-control form-control-line">
</div>
</div>
<div class="form-group">
<label class="col-md-12">Note (Optionally! Not Required)</label>
<div class="col-md-12">
<input name="bonus_note" type="text" class="form-control form-control-line">
</div>
</div>
<input name="moderator_id" type="hidden" value="{{ Auth::user()->id }}">
<div class="form-group">
<div class="col-sm-12">
<button class="btn btn-success" type="submit">{{ __('profile.update')}}</button>
</div>
</div>
</form>
#else
<form class="form-horizontal form-material" method="POST" action="{{ route ('total.store', ['lang' => App::getLocale()]) }}">
{{ csrf_field() }}
<input type="hidden" name='user_id' value='{!! $user->id !!}'>
<div class="form-group">
<label class="col-md-12">Total Dollar</label>
<div class="col-md-12">
<input name="old_dollar" type="text" value="#foreach ($dolars as $dolar)
{{ $dolar->dolar }}
#endforeach" class="form-control form-control-line" readonly>
</div>
</div>
<div class="form-group">
<label class="col-md-12">Paid Dollar</label>
<div class="col-md-12">
<input name="paid_dollar" type="text" class="form-control form-control-line">
</div>
</div>
<div class="form-group">
<label class="col-md-12">Note (Optionally! Not Required)</label>
<div class="col-md-12">
<input name="bonus_note" type="text" class="form-control form-control-line">
</div>
</div>
<input name="moderator_id" type="hidden" value="{{ Auth::user()->id }}">
<div class="form-group">
<div class="col-sm-12">
<button class="btn btn-success" type="submit">{{ __('profile.update')}}</button>
</div>
</div>
</form>
#endif
#endforeach
Best wishes.
The problem in your provided view is with the if condition. Here you are trying to count the user id which is not possible:-
#if (count($total->user_id) === 1)
Change the above code to
#if (count($total) === 1)

Laravel 5.3 - 500 internal error when saving a new Eloquent model

When trying to create a new instance of my model Apartment I get a 500 (Internal Server Error). I have other /create/ routes that I use to create new instance of my models and they work properly and they're set up same as ApartmentController#create, but for some weird reason it doesn't work.
ApartmentController#create
/**
* Show the form for creating a new resource.
*
* #return \Illuminate\Http\Response
*/
public function create()
{
$addresses = Address::all();
return view('address/create')->with('addresses', $addresses);
}
ApartmentController#store
/**
* Store a newly created resource in storage.
*
* #param \Illuminate\Http\Request $request
* #return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$address = new Address();
$this->authorize('create', $address);
$validator = Validator::make($request->all(), [
'building_number' => 'required|integer',
'street' => 'required|string',
]);
if ($validator->fails()) {
return redirect('addresses/create')
->withErrors($validator)
->withInput();
}
$address->building_number = $request->building_number;
$address->street = $request->street;
$address->save();
return redirect('addresses/create');
}
View apartment/create
<div class="col-md-6">
#if (count($errors) > 0)
<div class="alert alert-danger">
<ul>
#foreach ($errors->all() as $error)
<li>{{ $error }}</li>
#endforeach
</ul>
</div>
#endif
<form class="form-horizontal" method="POST" action="{{ action("ApartmentController#store") }}">
<fieldset>
<!-- Form Name -->
<legend>Register a new apartment</legend>
{{ csrf_field() }}
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="address_id">Address</label>
<div class="col-md-4">
<select id="address_id" name="address_id" class="form-control">
#foreach($addresses as $address)
<option value="{{$address->id}}">{{$address->street}} {{$address->building_number}}</option>
#endforeach
</select>
<span class="help-block">Apartments building number</span>
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="apartment_number">Apartment Number</label>
<div class="col-md-4">
<input id="apartment_number" name="apartment_number" type="text" placeholder="2402" class="form-control input-md" required="">
<span class="help-block">The apartment number</span>
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="size">Apartment Size</label>
<div class="col-md-4">
<input id="size" name="size" type="text" placeholder="56qm" class="form-control input-md" required="">
<span class="help-block">The size of the apartment in qm</span>
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="living_area_size">Living Area Size</label>
<div class="col-md-4">
<input id="living_area_size" name="living_area_size" type="text" placeholder="23qm" class="form-control input-md" required="">
<span class="help-block">The size of the living area in qm</span>
</div>
</div>
<!-- Select Basic -->
<div class="form-group">
<label class="col-md-4 control-label" for="suitable_for">Suitable For</label>
<div class="col-md-4">
<select id="suitable_for" name="suitable_for" class="form-control">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
<span class="help-block">Number of people the apartment is suitable for.</span>
</div>
</div>
<!-- Select Basic -->
<div class="form-group">
<label class="col-md-4 control-label" for="furnished">Furnished</label>
<div class="col-md-4">
<select id="furnished" name="furnished" class="form-control">
<option value="1">Yes</option>
<option value="0">No</option>
</select>
</div>
</div>
<!-- Select Basic -->
<div class="form-group">
<label class="col-md-4 control-label" for="balcony_or_terrace">Balcony or Terrace</label>
<div class="col-md-4">
<select id="balcony_or_terrace" name="balcony_or_terrace" class="form-control">
<option value="none">None</option>
<option value="balcony">Balcony</option>
<option value="terrace">Terrace</option>
</select>
</div>
</div>
<!-- Select Basic -->
<div class="form-group">
<label class="col-md-4 control-label" for="floor">Floor</label>
<div class="col-md-4">
<select id="floor" name="floor" class="form-control">
<option value="ground">Ground</option>
<option value="first">First</option>
<option value="second">Second</option>
<option value="third">Third</option>
</select>
</div>
</div>
<!-- Textarea -->
<div class="form-group">
<label class="col-md-4 control-label" for="description">Description</label>
<div class="col-md-6">
<textarea class="form-control" id="description" name="description"></textarea>
</div>
</div>
<!-- Button -->
<div class="form-group">
<label class="col-md-4 control-label" for="submit"></label>
<div class="col-md-4">
<button id="submit" name="submit" type="submit" class="btn btn-primary">Submit</button>
</div>
</div>
</fieldset>
</form>
</div>
<div class="col-md-4">
<legend>Registered Apartments</legend>
#foreach($apartments as $apartment)
<div class="address">
Apartment {{ $apartment->apartment_number }}
<a href="{{ url('/apartments/' . $apartment->id . '/edit') }}"
onclick="event.preventDefault();
document.getElementById('edit-form-{{$apartment->id}}').submit();">
<button class="btn btn-default">Edit</button>
</a>
<form id="edit-form-{{$apartment->id}}" action="{{ url('/apartments/' . $apartment->id . '/edit') }}" method="GET" style="display: none;">
{{ csrf_field() }}
<input type="hidden" name="address_id" value="{{$apartment->id}}">
</form>
<a href="{{ url('/apartments/' . $apartment->id) }}"
onclick="event.preventDefault();
document.getElementById('delete-form-{{$apartment->id}}').submit();">
<button class="btn btn-warning">Delete</button>
</a>
<form id="delete-form-{{$apartment->id}}" method="POST" action="/apartments/{{$apartment->id}}">
{{ csrf_field() }}
{{ method_field('DELETE') }}
</form>
</div>
<br>
#endforeach
</div>
Route web.php
Route::resource('apartments', 'ApartmentController');
apartments table for Apartment model
I tried to catch the exception on the save() method, but nothing is being caught and I still get redirected to /apartments without any Laravel error just Chroms 500 error page.
This is how I tried to catch the error using dwightwatson/validating:
try{
$apartment = new Apartment();
$apartment->apartment_number = $request->apartment_number;
$apartment->size = $request->size;
$apartment->living_area_size = $request->living_area_size;
$apartment->suitable_for = $request->suitable_for;
$apartment->furnished = $request->furnished;
$apartment->balcony_or_terrace = $request->balcony_or_terrace;
$apartment->floor = $request->floor;
$apartment->description = $request->description;
$apartment->address_id = $request->address_id;
$apartment->saveOrFail();
} catch (ValidationException $e) {
$errors = $e->getErrors();
return redirect()->route('apartments.create')
->withErrors($errors)
->withInput();
}
First of all, you Download Fiddler if you haven't already. Fire it up and then trigger the store method again. Fiddler should tell you a great deal about your request and response:
On the left side, you have a list of requests and on the right, you have statistics and inspectors. Under inspectors tab you will see WebView. Click it and you will see the error generated by Laravel.
As for why it might be failing, check if the references are included properly. e.g:
use App\Address;

Resources